Skip to content

Commit

Permalink
Fix flaky test - closes opensearch-project#7703
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
ashking94 committed Jun 2, 2023
1 parent ecd0879 commit 6ccff27
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.opensearch.test.OpenSearchIntegTestCase;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -47,8 +50,12 @@ public void testRemoteRefreshRetryOnFailure() throws Exception {
assertBusy(() -> {
Set<String> filesInLocal = getSegmentFiles(location.getRoot().resolve(segmentDataLocalPath));
Set<String> filesInRepo = getSegmentFiles(segmentDataRepoPath);
List<String> sortedFilesInLocal = new ArrayList<>(filesInLocal), sortedFilesInRepo = new ArrayList<>(filesInRepo);
Collections.sort(sortedFilesInLocal);
Collections.sort(sortedFilesInRepo);
logger.info("Local files = {}, Repo files = {}", sortedFilesInLocal, sortedFilesInRepo);
assertTrue(filesInRepo.containsAll(filesInLocal));
}, 60, TimeUnit.SECONDS);
}, 90, TimeUnit.SECONDS);
deleteRepo();
}

Expand Down

0 comments on commit 6ccff27

Please sign in to comment.