From fe7d018f0cb431d16062f18d3f7552781caf4ea6 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 4 May 2015 10:33:47 +0200 Subject: [PATCH] [TEST] make LuceneTest extraFS proof --- .../java/org/elasticsearch/common/lucene/LuceneTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java b/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java index 0420f4b2966..816409675af 100644 --- a/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java +++ b/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java @@ -144,8 +144,11 @@ public class LuceneTest extends ElasticsearchTestCase { } Lucene.cleanLuceneIndex(dir); if (dir.listAll().length > 0) { - assertEquals(dir.listAll().length, 1); - assertEquals(dir.listAll()[0], "write.lock"); + for (String file : dir.listAll()) { + if (file.startsWith("extra") == false) { + assertEquals(file, "write.lock"); + } + } } dir.close(); } @@ -200,7 +203,7 @@ public class LuceneTest extends ElasticsearchTestCase { assertEquals(s.search(new TermQuery(new Term("id", "4")), 1).totalHits, 0); for (String file : dir.listAll()) { - assertFalse("unexpected file: " + file, file.equals("segments_3") || file.startsWith("_2")); + assertFalse("unexpected file: " + file, file.equals("segments_3") || file.startsWith("_2") || file.startsWith("extra")); } open.close(); dir.close();