Fix global checkpoint listeners test
This commit fixes a global checkpoint listeners test wherein we were expecting an executor to have been used even if there were no listeners. This is silliness, so this commit adjusts the assertion to verify that the executor never fires if there are no listeners, and fires exactly once if there is one or more listeners.
This commit is contained in:
parent
f90f06ede1
commit
364ccc36d6
|
@ -341,7 +341,7 @@ public class GlobalCheckpointListenersTests extends ESTestCase {
|
||||||
globalCheckpointListeners.add(NO_OPS_PERFORMED, (g, e) -> {});
|
globalCheckpointListeners.add(NO_OPS_PERFORMED, (g, e) -> {});
|
||||||
}
|
}
|
||||||
globalCheckpointListeners.globalCheckpointUpdated(randomLongBetween(NO_OPS_PERFORMED, Long.MAX_VALUE));
|
globalCheckpointListeners.globalCheckpointUpdated(randomLongBetween(NO_OPS_PERFORMED, Long.MAX_VALUE));
|
||||||
assertThat(count.get(), equalTo(1));
|
assertThat(count.get(), equalTo(numberOfListeners == 0 ? 0 : 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConcurrency() throws BrokenBarrierException, InterruptedException {
|
public void testConcurrency() throws BrokenBarrierException, InterruptedException {
|
||||||
|
|
Loading…
Reference in New Issue