Skip to content

Commit

Permalink
check position before and after latch (#42623)
Browse files Browse the repository at this point in the history
check position before and after latch

#fixes 42084
  • Loading branch information
Hendrik Muhs committed May 28, 2019
1 parent e54e748 commit ace96a2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/42084")
public void testStateMachine() throws Exception {
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ExecutorService executor = Executors.newFixedThreadPool(1);
Expand All @@ -236,10 +235,11 @@ public void testStateMachine() throws Exception {
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
assertTrue(awaitBusy(() -> indexer.getPosition() == 2));
countDownLatch.countDown();

assertThat(indexer.getPosition(), equalTo(2));
assertTrue(awaitBusy(() -> isFinished.get()));
assertThat(indexer.getPosition(), equalTo(3));

assertFalse(isStopped.get());
assertThat(indexer.getStep(), equalTo(6));
assertThat(indexer.getStats().getNumInvocations(), equalTo(1L));
Expand Down

0 comments on commit ace96a2

Please sign in to comment.