Skip to content

Commit e965a6f

Browse files
authored
Fix remote settings upgrade test (#49609)
This commit fixes #49587. Due to a settings change, the broken test was asserting on the incorrect setting. This commit fixes that issue and adds additional assertions to ensure that all settings are working properly.
1 parent 996cdeb commit e965a6f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.elasticsearch.upgrades;
2121

22-
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
2322
import org.elasticsearch.Version;
2423
import org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse;
2524
import org.elasticsearch.client.Request;
@@ -37,11 +36,10 @@
3736
import java.util.Collections;
3837

3938
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
40-
import static org.elasticsearch.transport.SniffConnectionStrategy.SEARCH_REMOTE_CLUSTERS_SEEDS;
4139
import static org.elasticsearch.transport.RemoteClusterService.SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE;
40+
import static org.elasticsearch.transport.SniffConnectionStrategy.SEARCH_REMOTE_CLUSTERS_SEEDS;
4241
import static org.hamcrest.Matchers.equalTo;
4342

44-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/49587")
4543
public class FullClusterRestartSettingsUpgradeIT extends AbstractFullClusterRestartTestCase {
4644

4745
public void testRemoteClusterSettingsUpgraded() throws IOException {
@@ -94,10 +92,16 @@ public void testRemoteClusterSettingsUpgraded() throws IOException {
9492
RemoteClusterService.REMOTE_CLUSTER_SKIP_UNAVAILABLE.getConcreteSettingForNamespace("foo").exists(settings));
9593
assertTrue(RemoteClusterService.REMOTE_CLUSTER_SKIP_UNAVAILABLE.getConcreteSettingForNamespace("foo").get(settings));
9694
assertFalse(SEARCH_REMOTE_CLUSTERS_SEEDS.getConcreteSettingForNamespace("foo").exists(settings));
97-
assertTrue(SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS.getConcreteSettingForNamespace("foo").exists(settings));
95+
assertTrue(SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS_OLD.getConcreteSettingForNamespace("foo").exists(settings));
96+
assertFalse(SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS.getConcreteSettingForNamespace("foo").exists(settings));
97+
assertTrue(SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS.getConcreteSettingForNamespace("foo")
98+
.existsOrFallbackExists(settings));
9899
assertThat(
99100
SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS.getConcreteSettingForNamespace("foo").get(settings),
100101
equalTo(Collections.singletonList("localhost:9200")));
102+
assertThat(
103+
SniffConnectionStrategy.REMOTE_CLUSTER_SEEDS_OLD.getConcreteSettingForNamespace("foo").get(settings),
104+
equalTo(Collections.singletonList("localhost:9200")));
101105
}
102106
}
103107
}

0 commit comments

Comments
 (0)