Skip to content

Commit d8be6ef

Browse files
committed
fix 145957
1 parent dbf0195 commit d8be6ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/async/AsyncTaskManagementServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,13 @@ public void execute(TestRequest request, TestTask task, ActionListener<TestRespo
288288
// now we are waiting for the task to finish
289289
logger.trace("Waiting for response to complete");
290290
AtomicReference<StoredAsyncResponse<TestResponse>> responseRef = new AtomicReference<>();
291+
// Unblock execute before wait-for-completion so the listener timeout measures task completion, not time blocked on executionLatch.
292+
executionLatch.countDown();
291293
CountDownLatch getResponseCountDown = getResponse(
292294
responseHolder.get().id,
293295
TimeValue.timeValueSeconds(5),
294296
ActionTestUtils.assertNoFailureListener(responseRef::set)
295297
);
296-
297-
executionLatch.countDown();
298298
assertThat(getResponseCountDown.await(10, TimeUnit.SECONDS), equalTo(true));
299299

300300
StoredAsyncResponse<TestResponse> response = responseRef.get();

0 commit comments

Comments
 (0)