Skip to content

Commit d463d3a

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 0c1dc3a commit d463d3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

311311
// run indexer a 2nd time
312312
final CountDownLatch secondRunLatch = indexer.newLatch(1);
313-
indexer.start();
314313
assertEquals(pageSizeAfterFirstReduction, indexer.getPageSize());
315314
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
316-
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
315+
// when the indexer thread shuts down, it ignores the trigger, we might have to call it again
316+
assertBusy(() -> assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis())));
317317
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
318318

319319
secondRunLatch.countDown();

0 commit comments

Comments
 (0)