Skip to content

Commit 2e836cf

Browse files
authored
Relax profile assertion in single-node rest test (elastic#119778)
In serverless, the single-node rest tests are run with more than one node, and node-level reduction is enabled if the coordinator and the data node are different. This change relaxes the profile assertion to account for this case.
1 parent 958a861 commit 2e836cf

File tree

1 file changed

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

1 file changed

+15
-14
lines changed

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,23 @@ public void testProfile() throws IOException {
312312
}
313313
signatures.add(sig);
314314
}
315+
var readProfile = matchesList().item("LuceneSourceOperator")
316+
.item("ValuesSourceReaderOperator")
317+
.item("AggregationOperator")
318+
.item("ExchangeSinkOperator");
319+
var mergeProfile = matchesList().item("ExchangeSourceOperator")
320+
.item("AggregationOperator")
321+
.item("ProjectOperator")
322+
.item("LimitOperator")
323+
.item("EvalOperator")
324+
.item("ProjectOperator")
325+
.item("OutputOperator");
326+
var emptyReduction = matchesList().item("ExchangeSourceOperator").item("ExchangeSinkOperator");
327+
var reduction = matchesList().item("ExchangeSourceOperator").item("AggregationOperator").item("ExchangeSinkOperator");
315328
assertThat(
316329
signatures,
317-
containsInAnyOrder(
318-
matchesList().item("LuceneSourceOperator")
319-
.item("ValuesSourceReaderOperator")
320-
.item("AggregationOperator")
321-
.item("ExchangeSinkOperator"),
322-
matchesList().item("ExchangeSourceOperator").item("ExchangeSinkOperator"),
323-
matchesList().item("ExchangeSourceOperator")
324-
.item("AggregationOperator")
325-
.item("ProjectOperator")
326-
.item("LimitOperator")
327-
.item("EvalOperator")
328-
.item("ProjectOperator")
329-
.item("OutputOperator")
330-
)
330+
Matchers.either(containsInAnyOrder(readProfile, reduction, mergeProfile))
331+
.or(containsInAnyOrder(readProfile, emptyReduction, mergeProfile))
331332
);
332333
}
333334

0 commit comments

Comments
 (0)