Skip to content

Commit c57cdf3

Browse files
authored
Relax profiles assertions (elastic#123919) (elastic#123942)
If the final driver is woken up before the exchange buffer is finished, there will be two sleeps in its profile instead of one. We don't need these assertions to be so precise. This change relaxes the assertions to allow reduce operators to have more than one sleep. Closes elastic#123210
1 parent a425c05 commit c57cdf3

File tree

1 file changed

+10
-20
lines changed
  • x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node

1 file changed

+10
-20
lines changed

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/RestEsqlIT.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -493,26 +493,16 @@ public void testForceSleepsProfile() throws IOException {
493493
if (operators.contains("LuceneSourceOperator")) {
494494
assertMap(sleeps, matchesMap().entry("counts", Map.of()).entry("first", List.of()).entry("last", List.of()));
495495
} else if (operators.contains("ExchangeSourceOperator")) {
496-
if (operators.contains("ExchangeSinkOperator")) {
497-
assertMap(sleeps, matchesMap().entry("counts", matchesMap().entry("exchange empty", greaterThan(0))).extraOk());
498-
@SuppressWarnings("unchecked")
499-
List<Map<String, Object>> first = (List<Map<String, Object>>) sleeps.get("first");
500-
for (Map<String, Object> s : first) {
501-
assertMap(s, sleepMatcher);
502-
}
503-
@SuppressWarnings("unchecked")
504-
List<Map<String, Object>> last = (List<Map<String, Object>>) sleeps.get("last");
505-
for (Map<String, Object> s : last) {
506-
assertMap(s, sleepMatcher);
507-
}
508-
509-
} else {
510-
assertMap(
511-
sleeps,
512-
matchesMap().entry("counts", matchesMap().entry("exchange empty", 1))
513-
.entry("first", List.of(sleepMatcher))
514-
.entry("last", List.of(sleepMatcher))
515-
);
496+
assertMap(sleeps, matchesMap().entry("counts", matchesMap().entry("exchange empty", greaterThan(0))).extraOk());
497+
@SuppressWarnings("unchecked")
498+
List<Map<String, Object>> first = (List<Map<String, Object>>) sleeps.get("first");
499+
for (Map<String, Object> s : first) {
500+
assertMap(s, sleepMatcher);
501+
}
502+
@SuppressWarnings("unchecked")
503+
List<Map<String, Object>> last = (List<Map<String, Object>>) sleeps.get("last");
504+
for (Map<String, Object> s : last) {
505+
assertMap(s, sleepMatcher);
516506
}
517507
} else {
518508
fail("unknown signature: " + operators);

0 commit comments

Comments
 (0)