Skip to content

Commit

Permalink
Relax profile assertion in single-node rest test (elastic#119778)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dnhatn authored Jan 15, 2025
1 parent 958a861 commit 2e836cf
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,23 @@ public void testProfile() throws IOException {
}
signatures.add(sig);
}
var readProfile = matchesList().item("LuceneSourceOperator")
.item("ValuesSourceReaderOperator")
.item("AggregationOperator")
.item("ExchangeSinkOperator");
var mergeProfile = matchesList().item("ExchangeSourceOperator")
.item("AggregationOperator")
.item("ProjectOperator")
.item("LimitOperator")
.item("EvalOperator")
.item("ProjectOperator")
.item("OutputOperator");
var emptyReduction = matchesList().item("ExchangeSourceOperator").item("ExchangeSinkOperator");
var reduction = matchesList().item("ExchangeSourceOperator").item("AggregationOperator").item("ExchangeSinkOperator");
assertThat(
signatures,
containsInAnyOrder(
matchesList().item("LuceneSourceOperator")
.item("ValuesSourceReaderOperator")
.item("AggregationOperator")
.item("ExchangeSinkOperator"),
matchesList().item("ExchangeSourceOperator").item("ExchangeSinkOperator"),
matchesList().item("ExchangeSourceOperator")
.item("AggregationOperator")
.item("ProjectOperator")
.item("LimitOperator")
.item("EvalOperator")
.item("ProjectOperator")
.item("OutputOperator")
)
Matchers.either(containsInAnyOrder(readProfile, reduction, mergeProfile))
.or(containsInAnyOrder(readProfile, emptyReduction, mergeProfile))
);
}

Expand Down

0 comments on commit 2e836cf

Please sign in to comment.