Skip to content

Commit a3ff408

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 4ed68f8 commit a3ff408

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
@@ -341,10 +341,11 @@ public void testPageSizeAdapt() throws Exception {
341341

342342
// run indexer a 2nd time
343343
final CountDownLatch secondRunLatch = indexer.newLatch(1);
344-
indexer.start();
345344
assertEquals(pageSizeAfterFirstReduction, indexer.getPageSize());
346345
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
347-
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
346+
347+
// when the indexer thread shuts down, it ignores the trigger, we might have to call it again
348+
assertBusy(() -> assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis())));
348349
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
349350

350351
secondRunLatch.countDown();

0 commit comments

Comments
 (0)