Skip to content

Commit c0886cf

Browse files
author
Christoph Büscher
authored
[Tests] Relax assertion in SuggestStatsIT (#28544)
The test expects suggest times in milliseconds that are strictly positive. Internally they are measured in nanos, it is possible that on really fast execution this is rounded to 0L, so this should also be an accepted value. Closes #28543
1 parent 305b87b commit c0886cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/java/org/elasticsearch/index/suggest/stats/SuggestStatsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void testSimpleStats() throws Exception {
112112

113113
logger.info("iter {}, iter1 {}, iter2 {}, {}", suggestAllIdx, suggestIdx1, suggestIdx2, endTime - startTime);
114114
// check suggest time
115-
assertThat(suggest.getSuggestTimeInMillis(), greaterThan(0L));
115+
assertThat(suggest.getSuggestTimeInMillis(), greaterThanOrEqualTo(0L));
116116
// the upperbound is num shards * total time since we do searches in parallel
117117
assertThat(suggest.getSuggestTimeInMillis(), lessThanOrEqualTo(totalShards * (endTime - startTime)));
118118

@@ -124,7 +124,7 @@ public void testSimpleStats() throws Exception {
124124
logger.info("evaluating {}", stat.getNode());
125125
if (nodeIdsWithIndex.contains(stat.getNode().getId())) {
126126
assertThat(suggestStats.getSuggestCount(), greaterThan(0L));
127-
assertThat(suggestStats.getSuggestTimeInMillis(), greaterThan(0L));
127+
assertThat(suggestStats.getSuggestTimeInMillis(), greaterThanOrEqualTo(0L));
128128
num++;
129129
} else {
130130
assertThat(suggestStats.getSuggestCount(), equalTo(0L));

0 commit comments

Comments
 (0)