Skip to content

Commit c9e7e5a

Browse files
authored
ESQL: Allow some error in test (#126865)
Without #123290 we're not going to get accurate status reports. They are indicative, but not accurate. Closes #126808
1 parent 2e00fb8 commit c9e7e5a

File tree

1 file changed

+6
-5
lines changed
  • x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator

1 file changed

+6
-5
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/DriverTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
import static org.hamcrest.Matchers.either;
5151
import static org.hamcrest.Matchers.equalTo;
52+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
5253

5354
public class DriverTests extends ESTestCase {
5455
/**
@@ -90,13 +91,13 @@ public void testProfileAndStatusFinishInOneRound() {
9091
assertThat(driver.status().status(), equalTo(DriverStatus.Status.DONE));
9192
assertThat(driver.status().started(), equalTo(startEpoch));
9293
long sumRunningTime = tickTime * (nowSupplier.callCount - 1);
93-
assertThat(driver.status().cpuNanos(), equalTo(sumRunningTime));
94-
assertThat(driver.status().iterations(), equalTo((long) inPages.size()));
94+
assertThat(driver.status().cpuNanos(), greaterThanOrEqualTo(sumRunningTime)); // GTE to work around not having #123290
95+
assertThat(driver.status().iterations(), greaterThanOrEqualTo((long) inPages.size()));// GTE to work around not having #123290
9596

9697
logger.info("profile {}", driver.profile());
97-
assertThat(driver.profile().tookNanos(), equalTo(waitTime + sumRunningTime));
98-
assertThat(driver.profile().cpuNanos(), equalTo(sumRunningTime));
99-
assertThat(driver.profile().iterations(), equalTo((long) inPages.size()));
98+
assertThat(driver.profile().tookNanos(), greaterThanOrEqualTo(waitTime + sumRunningTime));
99+
assertThat(driver.profile().cpuNanos(), greaterThanOrEqualTo(sumRunningTime));
100+
assertThat(driver.profile().iterations(), greaterThanOrEqualTo((long) inPages.size()));
100101
}
101102

102103
/**

0 commit comments

Comments
 (0)