Skip to content

Commit 41d2f08

Browse files
author
Hendrik Muhs
committed
[Transform] fix itermittent problem in TransformIndexerTests/TransformIndexerFailureHandlingTests (#70326)
fix a race condition in the test: the indexer thread might still be in the process of shutting down, when the test thread triggers it again. relates #69551 fixes #70297
1 parent 3aea9b1 commit 41d2f08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,11 @@ public void testPageSizeAdapt() throws Exception {
333333

334334
// run indexer a 2nd time
335335
final CountDownLatch secondRunLatch = indexer.newLatch(1);
336-
indexer.start();
337336
assertEquals(pageSizeAfterFirstReduction, indexer.getPageSize());
338337
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
339-
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
338+
339+
// when the indexer thread shuts down, it ignores the trigger, we might have to call it again
340+
assertBusy(() -> assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis())));
340341
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
341342

342343
secondRunLatch.countDown();

0 commit comments

Comments
 (0)