Fix PersistedClusterStateServiceTests.testSlowLogging (#57971)

The range in the last writeDurationMillis selection could be empty, as it could prior to the call be set to 1.
This commit is contained in:
Yannick Welsch 2020-06-11 15:37:43 +02:00
parent 947573f309
commit 34fc52dbf3
1 changed files with 1 additions and 1 deletions

View File

@ -858,7 +858,7 @@ public class PersistedClusterStateServiceTests extends ESTestCase {
"writing cluster state took [*] which is above the warn threshold of [*]; " + "writing cluster state took [*] which is above the warn threshold of [*]; " +
"wrote global metadata [false] and metadata for [1] indices and skipped [0] unchanged indices")); "wrote global metadata [false] and metadata for [1] indices and skipped [0] unchanged indices"));
writeDurationMillis.set(randomLongBetween(1, writeDurationMillis.get() - 1)); writeDurationMillis.set(randomLongBetween(0, writeDurationMillis.get() - 1));
assertExpectedLogs(1L, clusterState, newClusterState, writer, new MockLogAppender.UnseenEventExpectation( assertExpectedLogs(1L, clusterState, newClusterState, writer, new MockLogAppender.UnseenEventExpectation(
"should not see warning below threshold", "should not see warning below threshold",
PersistedClusterStateService.class.getCanonicalName(), PersistedClusterStateService.class.getCanonicalName(),