Skip to content

Commit eeb2f39

Browse files
authored
Fix flaky test in RemoteStoreMigrationSettingsUpdateIT (#16048)
Signed-off-by: Ashish Singh <ssashish@amazon.com>
1 parent c85ee68 commit eeb2f39

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

server/src/internalClusterTest/java/org/opensearch/remotemigration/RemoteStoreMigrationSettingsUpdateIT.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.opensearch.common.settings.Settings;
1313
import org.opensearch.common.settings.SettingsException;
1414
import org.opensearch.common.unit.TimeValue;
15+
import org.opensearch.repositories.blobstore.BlobStoreRepository;
1516
import org.opensearch.test.InternalTestCluster;
1617
import org.opensearch.test.OpenSearchIntegTestCase;
1718

@@ -68,15 +69,17 @@ public void testNewIndexIsRemoteStoreBackedForRemoteStoreDirectionAndMixedMode()
6869
assertRemoteStoreBackedIndex(indexName2);
6970
}
7071

71-
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/15793")
7272
public void testNewRestoredIndexIsRemoteStoreBackedForRemoteStoreDirectionAndMixedMode() throws Exception {
7373
logger.info("Initialize cluster: gives non remote cluster manager");
7474
initializeCluster(false);
7575

7676
logger.info("Add remote and non-remote nodes");
7777
setClusterMode(MIXED.mode);
7878
addRemote = false;
79-
String nonRemoteNodeName = internalCluster().startNode();
79+
Settings settings = Settings.builder()
80+
.put(BlobStoreRepository.SNAPSHOT_SHARD_PATH_PREFIX_SETTING.getKey(), snapshotShardPathFixedPrefix ? "c" : "")
81+
.build();
82+
String nonRemoteNodeName = internalCluster().startNode(settings);
8083
addRemote = true;
8184
String remoteNodeName = internalCluster().startNode();
8285
internalCluster().validateClusterFormed();

test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public abstract class OpenSearchIntegTestCase extends OpenSearchTestCase {
403403

404404
private static Boolean segmentsPathFixedPrefix;
405405

406-
private static Boolean snapshotShardPathFixedPrefix;
406+
protected static Boolean snapshotShardPathFixedPrefix;
407407

408408
private Path remoteStoreRepositoryPath;
409409

@@ -2904,7 +2904,7 @@ private static Settings buildRemoteStoreNodeAttributes(
29042904
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_PINNED_TIMESTAMP_ENABLED.getKey(), randomBoolean());
29052905
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_SEGMENTS_PATH_PREFIX.getKey(), translogPathFixedPrefix ? "a" : "");
29062906
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_TRANSLOG_PATH_PREFIX.getKey(), segmentsPathFixedPrefix ? "b" : "");
2907-
settings.put(BlobStoreRepository.SNAPSHOT_SHARD_PATH_PREFIX_SETTING.getKey(), segmentsPathFixedPrefix ? "c" : "");
2907+
settings.put(BlobStoreRepository.SNAPSHOT_SHARD_PATH_PREFIX_SETTING.getKey(), snapshotShardPathFixedPrefix ? "c" : "");
29082908
return settings.build();
29092909
}
29102910

0 commit comments

Comments
 (0)