Skip to content

Commit c8c6888

Browse files
authored
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.
1 parent 8534bd5 commit c8c6888

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.elasticsearch.common.settings.Settings;
2929
import org.elasticsearch.common.unit.ByteSizeUnit;
3030
import org.elasticsearch.common.unit.ByteSizeValue;
31-
import org.elasticsearch.license.LicenseService;
3231
import org.elasticsearch.plugins.Plugin;
3332
import org.elasticsearch.test.ESIntegTestCase;
3433
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
@@ -38,6 +37,8 @@
3837
import java.util.Collection;
3938
import java.util.List;
4039

40+
import static org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING;
41+
import static org.elasticsearch.license.LicenseService.SELF_GENERATED_LICENSE_TYPE;
4142
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
4243
import static org.hamcrest.Matchers.equalTo;
4344

@@ -54,8 +55,10 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
5455

5556
@Override
5657
protected Settings nodeSettings(int nodeOrdinal) {
57-
final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
58-
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
58+
final Settings.Builder builder = Settings.builder()
59+
.put(super.nodeSettings(nodeOrdinal))
60+
.put(SELF_GENERATED_LICENSE_TYPE.getKey(), "trial")
61+
.put(CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), "none");
5962
if (randomBoolean()) {
6063
builder.put(
6164
CacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(),

0 commit comments

Comments
 (0)