Disable rebalancing in searchable snapshots tests (#61068)

Fixes a test failure in which we allocated some shards and then
relocated them elsewhere, invalidating an assertion about the recovery
statistics which assumed that the shards stayed where they were
originally allocated.

Closes #61067.
This commit is contained in:
David Turner 2020-08-13 08:43:04 +01:00
parent fb6f46936a
commit dd7410d8c2
1 changed files with 6 additions and 3 deletions

View File

@ -28,7 +28,6 @@ import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.license.LicenseService;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xpack.core.XPackSettings;
@ -39,6 +38,8 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING;
import static org.elasticsearch.license.LicenseService.SELF_GENERATED_LICENSE_TYPE;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.equalTo;
@ -60,8 +61,10 @@ public abstract class BaseSearchableSnapshotsIntegTestCase extends ESIntegTestCa
@Override
protected Settings nodeSettings(int nodeOrdinal) {
final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
final Settings.Builder builder = Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(SELF_GENERATED_LICENSE_TYPE.getKey(), "trial")
.put(CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), "none");
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
if (randomBoolean()) {
builder.put(