Skip to content

Commit 8cf7f92

Browse files
Fixing flaky test testRemoteIndexPathFileExistsAfterMigration (#15977) (#16033)
(cherry picked from commit 1343367) Signed-off-by: Shubh Sahu <shubhvs@amazon.com> 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 b67f765 commit 8cf7f92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.opensearch.common.settings.Settings;
2020
import org.opensearch.core.util.FileSystemUtils;
2121
import org.opensearch.index.remote.RemoteIndexPath;
22-
import org.opensearch.index.remote.RemoteIndexPathUploader;
2322
import org.opensearch.index.remote.RemoteStoreEnums;
2423
import org.opensearch.indices.replication.common.ReplicationType;
2524
import org.opensearch.test.InternalTestCluster;
@@ -533,17 +532,18 @@ public void testRemoteIndexPathFileExistsAfterMigration() throws Exception {
533532

534533
// validate remote index path file exists
535534
logger.info("---> Asserting remote index path file exists");
536-
String fileNamePrefix = String.join(RemoteIndexPathUploader.DELIMITER, indexUUID, "7", RemoteIndexPath.DEFAULT_VERSION);
537535

538536
assertTrue(FileSystemUtils.exists(translogRepoPath.resolve(RemoteIndexPath.DIR)));
539537
Path[] files = FileSystemUtils.files(translogRepoPath.resolve(RemoteIndexPath.DIR));
540538
assertEquals(1, files.length);
541-
assertTrue(Arrays.stream(files).anyMatch(file -> file.toString().contains(fileNamePrefix)));
539+
logger.info(files[0].toString());
540+
assertTrue(Arrays.stream(files).anyMatch(file -> file.toString().contains(indexUUID)));
542541

543542
assertTrue(FileSystemUtils.exists(segmentRepoPath.resolve(RemoteIndexPath.DIR)));
544543
files = FileSystemUtils.files(segmentRepoPath.resolve(RemoteIndexPath.DIR));
545544
assertEquals(1, files.length);
546-
assertTrue(Arrays.stream(files).anyMatch(file -> file.toString().contains(fileNamePrefix)));
545+
logger.info(files[0].toString());
546+
assertTrue(Arrays.stream(files).anyMatch(file -> file.toString().contains(indexUUID)));
547547
}
548548

549549
/**

0 commit comments

Comments
 (0)