From 131e45aa87f3f1d8c8586c16fd8d52b1fb8bdc77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 13 Jun 2023 15:45:00 +0000 Subject: [PATCH] Fix flaky test `SearchRestCancellationIT.testAutomaticCancellationMultiSearchDuringFetchPhase` (#7985) * add latch.await Signed-off-by: Stephen Crawford * remove space Signed-off-by: Stephen Crawford * Fix await timing Signed-off-by: Stephen Crawford * fix line Signed-off-by: Stephen Crawford * shorten await Signed-off-by: Stephen Crawford --------- Signed-off-by: Stephen Crawford (cherry picked from commit df517a6f69afe2a59f55daf5f3b0689128ee6879) Signed-off-by: github-actions[bot] --- .../test/java/org/opensearch/http/SearchRestCancellationIT.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qa/smoke-test-http/src/test/java/org/opensearch/http/SearchRestCancellationIT.java b/qa/smoke-test-http/src/test/java/org/opensearch/http/SearchRestCancellationIT.java index 63f4e2187e571..df5d485b2da6e 100644 --- a/qa/smoke-test-http/src/test/java/org/opensearch/http/SearchRestCancellationIT.java +++ b/qa/smoke-test-http/src/test/java/org/opensearch/http/SearchRestCancellationIT.java @@ -83,6 +83,7 @@ import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.instanceOf; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.awaitLatch; public class SearchRestCancellationIT extends HttpSmokeTestCase { @@ -183,6 +184,7 @@ public void onFailure(Exception exception) { } }); + latch.await(2, TimeUnit.SECONDS); awaitForBlock(plugins); cancellable.cancel(); ensureSearchTaskIsCancelled(searchAction, nodeIdToName::get);