From 0a40564068d024fd97051c5839c86f92a95b357f Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 9 Jan 2019 09:24:56 +0100 Subject: [PATCH] [Tests] Change cluster scope in CorruptedFileIT and FlushIT (#37229) These tests failed on CI multiple times in the past weeks because they use a test cluster with a SUITE scope that recreates nodes between tests. With such a scope, nodes can be recreated in between test executions and can inherit a node id from a previous test execution, while they are assigned a random data path. With the successive node recreations it is possible that a newly recreated node shares the same node id (but different data path) as a non recreated node. This commit changes the cluster scope of the CorruptedFileIT and FlushIT tests which often fail. The failure is reproducable with : ./gradlew :server:integTest -Dtests.seed=EF3A50C225CF377 -Dtests.class=org.elasticsearch.index.store.CorruptedFileIT -Dtests.security.manager=true -Dtests.locale=th-TH-u-nu-thai-x-lvariant-TH -Dtests.timezone=America/Rio_Branco -Dcompiler.java=11 -Druntime.java=8 --- .../java/org/elasticsearch/index/store/CorruptedFileIT.java | 2 +- .../src/test/java/org/elasticsearch/indices/flush/FlushIT.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/index/store/CorruptedFileIT.java b/server/src/test/java/org/elasticsearch/index/store/CorruptedFileIT.java index 966495faa1e..cd0c90f5077 100644 --- a/server/src/test/java/org/elasticsearch/index/store/CorruptedFileIT.java +++ b/server/src/test/java/org/elasticsearch/index/store/CorruptedFileIT.java @@ -107,7 +107,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; -@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE) +@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST) public class CorruptedFileIT extends ESIntegTestCase { @Override diff --git a/server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java b/server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java index f7d920d1729..5535a947d9e 100644 --- a/server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java +++ b/server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java @@ -64,6 +64,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; +@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST) public class FlushIT extends ESIntegTestCase { public void testWaitIfOngoing() throws InterruptedException {