Allow extra time for a warning to be logged (#43597)

Today we assert that a warning is logged after no more than
`discovery.cluster_formation_warning_timeout`, but the deterministic scheduler
adds a small amount of extra randomness to the timing of future events, causing
the following build to fail:

    ./gradlew :server:test --tests "org.elasticsearch.cluster.coordination.CoordinatorTests.testLogsWarningPeriodicallyIfClusterNotFormed" -Dtests.seed=DF35C28D4FA9EE2D

This commit adds an allowance for this extra time.
This commit is contained in:
David Turner 2019-06-25 20:04:24 +01:00
parent 76a750a0a0
commit e738f0e6d2
1 changed files with 1 additions and 1 deletions

View File

@ -1324,7 +1324,7 @@ public class CoordinatorTests extends ESTestCase {
equalTo(cluster.clusterNodes.stream().map(ClusterNode::getLocalNode).collect(Collectors.toSet()))); equalTo(cluster.clusterNodes.stream().map(ClusterNode::getLocalNode).collect(Collectors.toSet())));
} }
}); });
cluster.runFor(warningDelayMillis, "waiting for warning to be emitted"); cluster.runFor(warningDelayMillis + DEFAULT_DELAY_VARIABILITY, "waiting for warning to be emitted");
mockLogAppender.assertAllExpectationsMatched(); mockLogAppender.assertAllExpectationsMatched();
} finally { } finally {
mockLogAppender.stop(); mockLogAppender.stop();