Skip to content

Commit 4fb3993

Browse files
committed
Fix mixed threadlocal and supplied random use (elastic#52459)
Closes elastic#52450. `setRandomIndexSettings(...)` in `ESIntegTestCase` was using both a thread-local and a supplied source of randomness. Fix this method to only use the supplied source.
1 parent 57d6dd7 commit 4fb3993

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ protected Settings.Builder setRandomIndexSettings(Random random, Settings.Builde
448448
}
449449

450450
if (random.nextBoolean()) {
451-
builder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom("false", "checksum", "true"));
451+
builder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom(random, "false", "checksum", "true"));
452452
}
453453

454-
if (randomBoolean()) {
454+
if (random.nextBoolean()) {
455455
// keep this low so we don't stall tests
456456
builder.put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(),
457457
RandomNumbers.randomIntBetween(random, 1, 15) + "ms");

0 commit comments

Comments
 (0)