Test: mute testOldIndexes
Ensure greens times out often. See https://github.com/elastic/elasticsearch/issues/10434
This commit is contained in:
parent
9c209e46be
commit
59d6bd8881
|
@ -58,13 +58,7 @@ import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.SortedSet;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
@ -101,9 +95,9 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
@Override
|
@Override
|
||||||
public Settings nodeSettings(int ord) {
|
public Settings nodeSettings(int ord) {
|
||||||
return ImmutableSettings.builder()
|
return ImmutableSettings.builder()
|
||||||
.put(Node.HTTP_ENABLED, true) // for _upgrade
|
.put(Node.HTTP_ENABLED, true) // for _upgrade
|
||||||
.put(MergePolicyModule.MERGE_POLICY_TYPE_KEY, NoMergePolicyProvider.class) // disable merging so no segments will be upgraded
|
.put(MergePolicyModule.MERGE_POLICY_TYPE_KEY, NoMergePolicyProvider.class) // disable merging so no segments will be upgraded
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupCluster() throws Exception {
|
void setupCluster() throws Exception {
|
||||||
|
@ -111,8 +105,8 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
|
|
||||||
Path dataDir = newTempDirPath(LifecycleScope.SUITE);
|
Path dataDir = newTempDirPath(LifecycleScope.SUITE);
|
||||||
ImmutableSettings.Builder nodeSettings = ImmutableSettings.builder()
|
ImmutableSettings.Builder nodeSettings = ImmutableSettings.builder()
|
||||||
.put("path.data", dataDir.toAbsolutePath())
|
.put("path.data", dataDir.toAbsolutePath())
|
||||||
.put("node.master", false); // workaround for dangling index loading issue when node is master
|
.put("node.master", false); // workaround for dangling index loading issue when node is master
|
||||||
String loadingNode = internalCluster().startNode(nodeSettings.build());
|
String loadingNode = internalCluster().startNode(nodeSettings.build());
|
||||||
|
|
||||||
Path[] nodePaths = internalCluster().getInstance(NodeEnvironment.class, loadingNode).nodeDataPaths();
|
Path[] nodePaths = internalCluster().getInstance(NodeEnvironment.class, loadingNode).nodeDataPaths();
|
||||||
|
@ -167,10 +161,16 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
SortedSet<String> expectedVersions = new TreeSet<>();
|
SortedSet<String> expectedVersions = new TreeSet<>();
|
||||||
for (java.lang.reflect.Field field : Version.class.getDeclaredFields()) {
|
for (java.lang.reflect.Field field : Version.class.getDeclaredFields()) {
|
||||||
if (Modifier.isStatic(field.getModifiers()) && field.getType() == Version.class) {
|
if (Modifier.isStatic(field.getModifiers()) && field.getType() == Version.class) {
|
||||||
Version v = (Version)field.get(Version.class);
|
Version v = (Version) field.get(Version.class);
|
||||||
if (v.snapshot()) continue; // snapshots are unreleased, so there is no backcompat yet
|
if (v.snapshot()) {
|
||||||
if (v.onOrBefore(Version.V_0_20_6)) continue; // we can only test back one major lucene version
|
continue; // snapshots are unreleased, so there is no backcompat yet
|
||||||
if (v.equals(Version.CURRENT)) continue; // the current version is always compatible with itself
|
}
|
||||||
|
if (v.onOrBefore(Version.V_0_20_6)) {
|
||||||
|
continue; // we can only test back one major lucene version
|
||||||
|
}
|
||||||
|
if (v.equals(Version.CURRENT)) {
|
||||||
|
continue; // the current version is always compatible with itself
|
||||||
|
}
|
||||||
|
|
||||||
expectedVersions.add("index-" + v.toString() + ".zip");
|
expectedVersions.add("index-" + v.toString() + ".zip");
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LuceneTestCase.AwaitsFix(bugUrl = "times out often , see : https://github.com/elastic/elasticsearch/issues/10434")
|
||||||
public void testOldIndexes() throws Exception {
|
public void testOldIndexes() throws Exception {
|
||||||
setupCluster();
|
setupCluster();
|
||||||
|
|
||||||
|
@ -198,7 +199,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
logger.info("--> Testing old index " + index);
|
logger.info("--> Testing old index " + index);
|
||||||
assertOldIndexWorks(index);
|
assertOldIndexWorks(index);
|
||||||
logger.info("--> Done testing " + index + ", took " + ((System.currentTimeMillis() - startTime)/1000.0) + " seconds");
|
logger.info("--> Done testing " + index + ", took " + ((System.currentTimeMillis() - startTime) / 1000.0) + " seconds");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,10 +210,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
assertBasicSearchWorks(indexName);
|
assertBasicSearchWorks(indexName);
|
||||||
assertBasicAggregationWorks(indexName);
|
assertBasicAggregationWorks(indexName);
|
||||||
assertRealtimeGetWorks(indexName);
|
assertRealtimeGetWorks(indexName);
|
||||||
if (version.equals(Version.V_0_90_13) == false) {
|
assertNewReplicasWork(indexName);
|
||||||
// norelease: 0.90.13 can take too long to create replicas, see https://github.com/elastic/elasticsearch/issues/10434
|
|
||||||
assertNewReplicasWork(indexName);
|
|
||||||
}
|
|
||||||
assertUpgradeWorks(indexName, isLatestLuceneVersion(version));
|
assertUpgradeWorks(indexName, isLatestLuceneVersion(version));
|
||||||
assertDeleteByQueryWorked(indexName, version);
|
assertDeleteByQueryWorked(indexName, version);
|
||||||
unloadIndex(indexName);
|
unloadIndex(indexName);
|
||||||
|
@ -224,7 +222,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
|
|
||||||
boolean isLatestLuceneVersion(Version version) {
|
boolean isLatestLuceneVersion(Version version) {
|
||||||
return version.luceneVersion.major == Version.CURRENT.luceneVersion.major &&
|
return version.luceneVersion.major == Version.CURRENT.luceneVersion.major &&
|
||||||
version.luceneVersion.minor == Version.CURRENT.luceneVersion.minor;
|
version.luceneVersion.minor == Version.CURRENT.luceneVersion.minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,8 +278,8 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
|
|
||||||
void assertRealtimeGetWorks(String indexName) {
|
void assertRealtimeGetWorks(String indexName) {
|
||||||
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
||||||
.put("refresh_interval", -1)
|
.put("refresh_interval", -1)
|
||||||
.build()));
|
.build()));
|
||||||
SearchRequestBuilder searchReq = client().prepareSearch(indexName).setQuery(QueryBuilders.matchAllQuery());
|
SearchRequestBuilder searchReq = client().prepareSearch(indexName).setQuery(QueryBuilders.matchAllQuery());
|
||||||
SearchHit hit = searchReq.get().getHits().getAt(0);
|
SearchHit hit = searchReq.get().getHits().getAt(0);
|
||||||
String docId = hit.getId();
|
String docId = hit.getId();
|
||||||
|
@ -292,15 +290,15 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
assertThat(source, Matchers.hasKey("foo"));
|
assertThat(source, Matchers.hasKey("foo"));
|
||||||
|
|
||||||
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
||||||
.put("refresh_interval", EngineConfig.DEFAULT_REFRESH_INTERVAL)
|
.put("refresh_interval", EngineConfig.DEFAULT_REFRESH_INTERVAL)
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void assertNewReplicasWork(String indexName) throws Exception {
|
void assertNewReplicasWork(String indexName) throws Exception {
|
||||||
final int numReplicas = randomIntBetween(1, 2);
|
final int numReplicas = randomIntBetween(1, 2);
|
||||||
logger.debug("Creating [{}] replicas for index [{}]", numReplicas, indexName);
|
logger.debug("Creating [{}] replicas for index [{}]", numReplicas, indexName);
|
||||||
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
assertAcked(client().admin().indices().prepareUpdateSettings(indexName).setSettings(ImmutableSettings.builder()
|
||||||
.put("number_of_replicas", numReplicas)
|
.put("number_of_replicas", numReplicas)
|
||||||
).execute().actionGet());
|
).execute().actionGet());
|
||||||
ensureGreen(indexName);
|
ensureGreen(indexName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue