Skip to content

Commit

Permalink
Fixing flaky test testRemoteIndexPathFileExistsAfterMigration
Browse files Browse the repository at this point in the history
Signed-off-by: Shubh Sahu <shubhvs@amazon.com>
  • Loading branch information
Shubh Sahu committed Sep 18, 2024
1 parent b2a7136 commit 6e0d4f2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,17 +533,18 @@ public void testRemoteIndexPathFileExistsAfterMigration() throws Exception {

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

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

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

/**
Expand Down

0 comments on commit 6e0d4f2

Please sign in to comment.