Skip to content

Commit 37f6397

Browse files
author
Hendrik Muhs
authored
[Transform] make testRetentionPolicyExecution more robust (#68887)
relax test of the state in case the indexer threads runs quicker than expected.
1 parent 4e2bcb3 commit 37f6397

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/TransformIndexerTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import static org.elasticsearch.xpack.core.transform.transforms.SourceConfigTests.randomSourceConfig;
6161
import static org.elasticsearch.xpack.core.transform.transforms.pivot.PivotConfigTests.randomPivotConfig;
6262
import static org.hamcrest.Matchers.greaterThan;
63+
import static org.hamcrest.Matchers.oneOf;
6364
import static org.mockito.Mockito.mock;
6465

6566
public class TransformIndexerTests extends ESTestCase {
@@ -285,7 +286,7 @@ public void testRetentionPolicyExecution() throws Exception {
285286

286287
indexer.start();
287288
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
288-
assertEquals(indexer.getState(), IndexerState.INDEXING);
289+
assertThat(indexer.getState(), oneOf(IndexerState.INDEXING, IndexerState.STARTED));
289290

290291
assertBusy(() -> assertEquals(1L, indexer.getLastCheckpoint().getCheckpoint()), 5, TimeUnit.HOURS);
291292

0 commit comments

Comments
 (0)