Skip to content

Commit

Permalink
Tests: Disable automatic rebalancing on manual reallocation test
Browse files Browse the repository at this point in the history
Automatic rebalancing results in test failures/flakiness as the manual
reallocation inside the test may run concurrently.
  • Loading branch information
seut authored and mergify[bot] committed Feb 24, 2020
1 parent 9102920 commit f3439b8
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ESIntegTestCase;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.Test;

import java.util.ArrayList;
Expand All @@ -63,11 +64,20 @@ public class PartitionedTableConcurrentIntegrationTest extends SQLTransportInteg

private final TimeValue ACCEPTABLE_RELOCATION_TIME = new TimeValue(10, TimeUnit.SECONDS);

@After
public void resetSettings() throws Exception {
execute("RESET GLOBAL cluster.routing.rebalance.enable");
}

/**
* Test depends on 2 data nodes
*/
@Test
public void testSelectWhileShardsAreRelocating() throws Throwable {
// Automatic rebalancing would disturb our manual allocation and could lead to test failures as reallocation
// may be issued/run concurrently (by the test and by the cluster itself).
execute("SET GLOBAL cluster.routing.rebalance.enable = 'none'");

execute("create table t (name string, p string) " +
"clustered into 2 shards " +
"partitioned by (p) with (number_of_replicas = 0)");
Expand Down

0 comments on commit f3439b8

Please sign in to comment.