Skip to content

Commit

Permalink
Fix FsRepositoryTests.testSnapshotAndRestore (elastic#42925)
Browse files Browse the repository at this point in the history
* The commit generation can be 3 or 2 here -> fixed by checking the actual generation on the second commit instead of hard coding 2
* Closes elastic#42905
  • Loading branch information
original-brownbear committed Jun 20, 2019
1 parent 5af9387 commit 2738165
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@

public class FsRepositoryTests extends ESTestCase {

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/42905")
public void testSnapshotAndRestore() throws IOException, InterruptedException {
ThreadPool threadPool = new TestThreadPool(getClass().getSimpleName());
try (Directory directory = newDirectory()) {
Expand Down Expand Up @@ -149,7 +148,7 @@ public void testSnapshotAndRestore() throws IOException, InterruptedException {
secondState.getIndex().fileDetails().stream().filter(f -> f.reused() == false).collect(Collectors.toList());
Collections.sort(recoveredFiles, Comparator.comparing(RecoveryState.File::name));
assertTrue(recoveredFiles.get(0).name(), recoveredFiles.get(0).name().endsWith(".liv"));
assertTrue(recoveredFiles.get(1).name(), recoveredFiles.get(1).name().endsWith("segments_2"));
assertTrue(recoveredFiles.get(1).name(), recoveredFiles.get(1).name().endsWith("segments_" + incIndexCommit.getGeneration()));
} finally {
terminate(threadPool);
}
Expand Down

0 comments on commit 2738165

Please sign in to comment.