Skip to content

Commit 39fef83

Browse files
Fix FsRepositoryTests.testSnapshotAndRestore (#42925) (#43420)
* 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 #42905
1 parent 7d1983a commit 39fef83

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575

7676
public class FsRepositoryTests extends ESTestCase {
7777

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

0 commit comments

Comments
 (0)