Skip to content

Commit 02066da

Browse files
lktsalbertzaharovits
authored andcommitted
Another fix for rollup indexer tests (#110724)
I have recently fixed invocation of `maybeTriggerAsyncJob` in this test but now invocation count does not match since it counts every _attempt_ to start a job even if it was not successful.
1 parent f20aaf5 commit 02066da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import java.util.function.Function;
4242

4343
import static org.hamcrest.Matchers.equalTo;
44+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
4445
import static org.hamcrest.Matchers.startsWith;
4546
import static org.mockito.Mockito.doAnswer;
4647
import static org.mockito.Mockito.mock;
@@ -562,7 +563,6 @@ public void testMultipleJobTriggering() throws Exception {
562563
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
563564
latch.countDown();
564565
assertBusy(() -> assertThat(indexer.getState(), equalTo(IndexerState.STARTED)));
565-
assertThat(indexer.getStats().getNumInvocations(), equalTo((long) i + 1));
566566
assertThat(indexer.getStats().getNumPages(), equalTo((long) i + 1));
567567
}
568568
final CountDownLatch latch = indexer.newLatch();
@@ -572,6 +572,7 @@ public void testMultipleJobTriggering() throws Exception {
572572
latch.countDown();
573573
assertBusy(() -> assertThat(indexer.getState(), equalTo(IndexerState.STOPPED)));
574574
assertTrue(indexer.abort());
575+
assertThat(indexer.getStats().getNumInvocations(), greaterThanOrEqualTo(6L));
575576
} finally {
576577
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
577578
}

0 commit comments

Comments
 (0)