Skip to content

Commit 8838d77

Browse files
ES|QL: fix MultiClustersIT (elastic#131199)
(cherry picked from commit d154230) # Conflicts: # muted-tests.yml
1 parent 992e62d commit 8838d77

File tree

1 file changed

+10
-4
lines changed
  • x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq

1 file changed

+10
-4
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,16 @@ public void testNotLikeListKeyword() throws Exception {
530530
""", includeCCSMetadata);
531531
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
532532
Predicate<Doc> filter = d -> false == (d.color.contains("blue") || d.color.contains("red"));
533-
var values = List.of(
534-
List.of((int) remoteDocs.stream().filter(filter).count(), REMOTE_CLUSTER_NAME + ":" + remoteIndex),
535-
List.of((int) localDocs.stream().filter(filter).count(), localIndex)
536-
);
533+
534+
var values = new ArrayList<>();
535+
int remoteCount = (int) remoteDocs.stream().filter(filter).count();
536+
int localCount = (int) localDocs.stream().filter(filter).count();
537+
if (remoteCount > 0) {
538+
values.add(List.of(remoteCount, REMOTE_CLUSTER_NAME + ":" + remoteIndex));
539+
}
540+
if (localCount > 0) {
541+
values.add(List.of(localCount, localIndex));
542+
}
537543
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, true);
538544
}
539545

0 commit comments

Comments
 (0)