Skip to content

Commit e2e14c2

Browse files
authored
[TEST][7.17] Indexer state after call to stop() could be stopping or stopped (#120092)
Backport fix from #89955 Fixes #120083
1 parent 92cb5f1 commit e2e14c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.elasticsearch.xpack.core.rollup.job.RollupIndexerJobStats;
3232
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
3333
import org.elasticsearch.xpack.core.rollup.job.RollupJobConfig;
34+
import org.hamcrest.Matchers;
3435
import org.mockito.stubbing.Answer;
3536

3637
import java.io.IOException;
@@ -644,7 +645,7 @@ protected void onAbort() {
644645
final CountDownLatch latch = indexer.newLatch();
645646
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
646647
assertThat(indexer.stop(), equalTo(IndexerState.STOPPING));
647-
assertThat(indexer.getState(), equalTo(IndexerState.STOPPING));
648+
assertThat(indexer.getState(), Matchers.either(Matchers.is(IndexerState.STOPPING)).or(Matchers.is(IndexerState.STOPPED)));
648649
latch.countDown();
649650
assertBusy(() -> assertThat(indexer.getState(), equalTo(IndexerState.STOPPED)));
650651
assertTrue(indexer.abort());

0 commit comments

Comments
 (0)