103103import static org .hamcrest .Matchers .empty ;
104104import static org .hamcrest .Matchers .greaterThan ;
105105import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
106+ import static org .hamcrest .Matchers .lessThanOrEqualTo ;
106107import static org .hamcrest .Matchers .not ;
107108
108109/**
@@ -438,7 +439,6 @@ public void testSortByFieldOneClusterHasNoResults() throws Exception {
438439 assumeMultiClusterSetup ();
439440 SearchRequest searchRequest = initSearchRequest ();
440441 // set to a value greater than the number of shards to avoid differences due to the skipping of shards
441- searchRequest .setPreFilterShardSize (128 );
442442 SearchSourceBuilder sourceBuilder = new SearchSourceBuilder ();
443443 boolean onlyRemote = randomBoolean ();
444444 sourceBuilder .query (new TermQueryBuilder ("_index" , onlyRemote ? REMOTE_INDEX_NAME : INDEX_NAME ));
@@ -461,7 +461,6 @@ public void testSortByFieldOneClusterHasNoResults() throws Exception {
461461 });
462462 }
463463
464- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/79365" )
465464 public void testFieldCollapsingOneClusterHasNoResults () throws Exception {
466465 assumeMultiClusterSetup ();
467466 SearchRequest searchRequest = initSearchRequest ();
@@ -771,6 +770,7 @@ private static void duelSearch(SearchRequest searchRequest, Consumer<SearchRespo
771770 message .compareMaps (minimizeRoundtripsResponseMap , fanOutResponseMap );
772771 throw new AssertionError ("Didn't match expected value:\n " + message );
773772 }
773+ assertThat (minimizeRoundtripsSearchResponse .getSkippedShards (), lessThanOrEqualTo (fanOutSearchResponse .getSkippedShards ()));
774774 }
775775 }
776776
@@ -835,6 +835,10 @@ private static Map<String, Object> responseToMap(SearchResponse response) throws
835835 shard .remove ("fetch" );
836836 }
837837 }
838+ Map <String , Object > shards = (Map <String , Object >)responseMap .get ("_shards" );
839+ if (shards != null ) {
840+ shards .remove ("skipped" );
841+ }
838842 return responseMap ;
839843 }
840844
0 commit comments