Skip to content

Commit b1a271e

Browse files
committed
removed fetch from CSSDuelIT to prevent flaky test
Signed-off-by: Andre van de Ven <andrebvandeven@gmail.com>
1 parent 2f2d447 commit b1a271e

File tree

1 file changed

+16
-14
lines changed
  • qa/multi-cluster-search/src/test/java/org/opensearch/search

1 file changed

+16
-14
lines changed

qa/multi-cluster-search/src/test/java/org/opensearch/search/CCSDuelIT.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,18 @@ public void testHasChildWithInnerHit() throws Exception {
418418
duelSearch(searchRequest, CCSDuelIT::assertHits);
419419
}
420420

421-
// public void testProfile() throws Exception {
422-
// assumeMultiClusterSetup();
423-
// SearchRequest searchRequest = initSearchRequest();
424-
// SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
425-
// sourceBuilder.profile(true);
426-
// sourceBuilder.query(QueryBuilders.matchQuery("tags", "html"));
427-
// searchRequest.source(sourceBuilder);
428-
// duelSearch(searchRequest, response -> {
429-
// assertHits(response);
430-
// assertFalse(response.getProfileResults().isEmpty());
431-
// });
432-
// }
421+
public void testProfile() throws Exception {
422+
assumeMultiClusterSetup();
423+
SearchRequest searchRequest = initSearchRequest();
424+
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
425+
sourceBuilder.profile(true);
426+
sourceBuilder.query(QueryBuilders.matchQuery("tags", "html"));
427+
searchRequest.source(sourceBuilder);
428+
duelSearch(searchRequest, response -> {
429+
assertHits(response);
430+
assertFalse(response.getProfileResults().isEmpty());
431+
});
432+
}
433433

434434
public void testSortByField() throws Exception {
435435
assumeMultiClusterSetup();
@@ -831,10 +831,12 @@ private static Map<String, Object> responseToMap(SearchResponse response) throws
831831
Map<String, Object> responseMap = org.opensearch.common.xcontent.XContentHelper.convertToMap(bytesReference, false, MediaTypeRegistry.JSON).v2();
832832
assertNotNull(responseMap.put("took", -1));
833833
responseMap.remove("num_reduce_phases");
834-
Map<String, Object> profile = (Map<String, Object>)responseMap.get("profile");
834+
Map<String, Object> profile = (Map<String, Object>) responseMap.get("profile");
835835
if (profile != null) {
836-
List<Map<String, Object>> shards = (List <Map<String, Object>>)profile.get("shards");
836+
List<Map<String, Object>> shards = (List<Map<String, Object>>) profile.get("shards");
837837
for (Map<String, Object> shard : shards) {
838+
// Unconditionally remove the fetch profile to prevent flaky failures
839+
shard.remove("fetch");
838840
replaceProfileTime(shard);
839841
}
840842
}

0 commit comments

Comments
 (0)