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:
Jason Tedor 2018-08-15 15:53:15 -04:00
parent f90f06ede1
commit 364ccc36d6
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
1 changed files with 1 additions and 1 deletions

View File

@ -341,7 +341,7 @@ public class GlobalCheckpointListenersTests extends ESTestCase {
globalCheckpointListeners.add(NO_OPS_PERFORMED, (g, e) -> {});
}
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 {