From b5fa27819f3dec000b2e7e02a4156b2cf6d88f76 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 18 May 2020 13:59:20 +0100 Subject: [PATCH] Random iterations in testDataOnlyNodePersistence PR #56893 was supposed to randomise the iteration count in `testDataOnlyNodePersistence` but this change was mistakenly omitted. This commit addresses this. --- .../gateway/GatewayMetaStatePersistedStateTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java b/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java index f97006faf9294..c082c7871d3e4 100644 --- a/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java @@ -395,7 +395,8 @@ public void testDataOnlyNodePersistence() throws Exception { // generate a series of updates and check if batching works final String indexName = randomAlphaOfLength(10); long currentTerm = state.term(); - for (int i = 0; i < 1000; i++) { + final int iterations = randomIntBetween(1, 1000); + for (int i = 0; i < iterations; i++) { if (rarely()) { // bump term currentTerm = currentTerm + (rarely() ? randomIntBetween(1, 5) : 0L);