diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/CrossClusterAsyncSearchIT.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/CrossClusterAsyncSearchIT.java index cb5bddd8657ea..b40bf8413b661 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/CrossClusterAsyncSearchIT.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/CrossClusterAsyncSearchIT.java @@ -1752,6 +1752,7 @@ public void testCancellationViaTimeoutWithAllowPartialResultsSetToFalse() throws String remoteIndex = (String) testClusterInfo.get("remote.index"); SearchListenerPlugin.blockLocalQueryPhase(); + SearchListenerPlugin.blockRemoteQueryPhase(); TimeValue searchTimeout = new TimeValue(100, TimeUnit.MILLISECONDS); // query builder that will sleep for the specified amount of time in the query phase @@ -1809,6 +1810,7 @@ public void testCancellationViaTimeoutWithAllowPartialResultsSetToFalse() throws } finally { SearchListenerPlugin.allowLocalQueryPhase(); + SearchListenerPlugin.allowRemoteQueryPhase(); } // query phase has begun, so wait for query failure (due to timeout)