Fix mixed threadlocal and supplied random use (#52459)

Closes #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.
This commit is contained in:
Rory Hunter 2020-02-18 10:44:32 +00:00 committed by Rory Hunter
parent 57d6dd7e31
commit 4fb399396c
1 changed files with 2 additions and 2 deletions

View File

@ -448,10 +448,10 @@ public abstract class ESIntegTestCase extends ESTestCase {
}
if (random.nextBoolean()) {
builder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom("false", "checksum", "true"));
builder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom(random, "false", "checksum", "true"));
}
if (randomBoolean()) {
if (random.nextBoolean()) {
// keep this low so we don't stall tests
builder.put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(),
RandomNumbers.randomIntBetween(random, 1, 15) + "ms");