Skip to content

Commit

Permalink
[Transform] fix itermittent problem in TransformIndexerTests/Transfor…
Browse files Browse the repository at this point in the history
…mIndexerFailureHandlingTests (#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
  • Loading branch information
Hendrik Muhs committed Mar 15, 2021
1 parent 4ed68f8 commit a3ff408
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,11 @@ public void testPageSizeAdapt() throws Exception {

// run indexer a 2nd time
final CountDownLatch secondRunLatch = indexer.newLatch(1);
indexer.start();
assertEquals(pageSizeAfterFirstReduction, indexer.getPageSize());
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));

// when the indexer thread shuts down, it ignores the trigger, we might have to call it again
assertBusy(() -> assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis())));
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));

secondRunLatch.countDown();
Expand Down

0 comments on commit a3ff408

Please sign in to comment.