Skip to content

Commit b19f3c7

Browse files
Fix flaky test in RemoteStoreMigrationSettingsUpdateIT (#16048) (#16054)
(cherry picked from commit eeb2f39) Signed-off-by: Ashish Singh <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8cf7f92 commit b19f3c7

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

Lines changed: 5 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public abstract class OpenSearchIntegTestCase extends OpenSearchTestCase {
416416

417417
private static Boolean segmentsPathFixedPrefix;
418418

419-
private static Boolean snapshotShardPathFixedPrefix;
419+
protected static Boolean snapshotShardPathFixedPrefix;
420420

421421
@BeforeClass
422422
public static void beforeClass() throws Exception {
@@ -2947,7 +2947,7 @@ private static Settings buildRemoteStoreNodeAttributes(
29472947
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_PINNED_TIMESTAMP_ENABLED.getKey(), false);
29482948
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_SEGMENTS_PATH_PREFIX.getKey(), translogPathFixedPrefix ? "a" : "");
29492949
settings.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_TRANSLOG_PATH_PREFIX.getKey(), segmentsPathFixedPrefix ? "b" : "");
2950-
settings.put(BlobStoreRepository.SNAPSHOT_SHARD_PATH_PREFIX_SETTING.getKey(), segmentsPathFixedPrefix ? "c" : "");
2950+
settings.put(BlobStoreRepository.SNAPSHOT_SHARD_PATH_PREFIX_SETTING.getKey(), snapshotShardPathFixedPrefix ? "c" : "");
29512951
return settings.build();
29522952
}
29532953

0 commit comments

Comments
 (0)