Skip to content

Commit

Permalink
Fix flaky test `SearchRestCancellationIT.testAutomaticCancellationMul…
Browse files Browse the repository at this point in the history
…tiSearchDuringFetchPhase` (#7985)

* add latch.await

Signed-off-by: Stephen Crawford <[email protected]>

* remove space

Signed-off-by: Stephen Crawford <[email protected]>

* Fix await timing

Signed-off-by: Stephen Crawford <[email protected]>

* fix line

Signed-off-by: Stephen Crawford <[email protected]>

* shorten await

Signed-off-by: Stephen Crawford <[email protected]>

---------

Signed-off-by: Stephen Crawford <[email protected]>
(cherry picked from commit df517a6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jun 13, 2023
1 parent 2a8eb78 commit 131e45a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -183,6 +184,7 @@ public void onFailure(Exception exception) {
}
});

latch.await(2, TimeUnit.SECONDS);
awaitForBlock(plugins);
cancellable.cancel();
ensureSearchTaskIsCancelled(searchAction, nodeIdToName::get);
Expand Down

0 comments on commit 131e45a

Please sign in to comment.