From 27381650d5df0d1b68da06ac72da4b7347181d19 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Fri, 7 Jun 2019 14:26:35 +0200 Subject: [PATCH] Fix FsRepositoryTests.testSnapshotAndRestore (#42925) * 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 --- .../org/elasticsearch/repositories/fs/FsRepositoryTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java b/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java index 5bb4d4f065e79..1dc7a6263d37b 100644 --- a/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java @@ -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()) { @@ -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); }