Skip to content

Commit

Permalink
Fix PersistedClusterStateServiceTests.testSlowLogging (#57971)
Browse files Browse the repository at this point in the history
The range in the last writeDurationMillis selection could be empty, as it could prior to the call be set to 1.
  • Loading branch information
ywelsch committed Jun 11, 2020
1 parent cc9e00d commit cfef59f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ public void testSlowLogging() throws IOException, IllegalAccessException {
"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"));

writeDurationMillis.set(randomLongBetween(1, writeDurationMillis.get() - 1));
writeDurationMillis.set(randomLongBetween(0, writeDurationMillis.get() - 1));
assertExpectedLogs(1L, clusterState, newClusterState, writer, new MockLogAppender.UnseenEventExpectation(
"should not see warning below threshold",
PersistedClusterStateService.class.getCanonicalName(),
Expand Down

0 comments on commit cfef59f

Please sign in to comment.