Skip to content

Commit 39a3875

Browse files
authored
[7.x] Fix SegmentsStatsTests.testFileExtensionDescriptions (#67166) (#67195)
Lucene may create a lock file in this directory as part of creating a directory or writer, and we should ignore that when checking the list of files against known segment stats. Resolves #65267
1 parent 443d308 commit 39a3875

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/test/java/org/elasticsearch/index/engine/SegmentsStatsTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
public class SegmentsStatsTests extends ESTestCase {
3939

40-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/65267")
4140
public void testFileExtensionDescriptions() throws Exception {
4241
try (Directory dir = newDirectory()) {
4342
try (IndexWriter w = new IndexWriter(dir, new IndexWriterConfig()
@@ -64,8 +63,13 @@ public void testFileExtensionDescriptions() throws Exception {
6463

6564
for (String file : dir.listAll()) {
6665
final String extension = IndexFileNames.getExtension(file);
66+
if ("lock".equals(extension)) {
67+
// We should ignore lock files for stats file comparisons
68+
continue;
69+
}
6770
if (extension != null) {
68-
assertTrue(SegmentsStats.FILE_DESCRIPTIONS.get(extension) != null);
71+
assertNotNull("extension [" + extension + "] was not contained in the known segment stats files",
72+
SegmentsStats.FILE_DESCRIPTIONS.get(extension));
6973
}
7074
}
7175
}

0 commit comments

Comments
 (0)