lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1661945 - /lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java
Date Tue, 24 Feb 2015 13:35:04 GMT
Author: rmuir
Date: Tue Feb 24 13:35:04 2015
New Revision: 1661945

URL: http://svn.apache.org/r1661945
Log:
fix nonreproducible failures

Modified:
    lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java

Modified: lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java?rev=1661945&r1=1661944&r2=1661945&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40CompoundFormat.java
Tue Feb 24 13:35:04 2015
@@ -18,6 +18,7 @@ package org.apache.lucene.codecs.lucene4
  */
 
 import java.io.IOException;
+import java.util.Arrays;
 
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.index.BaseCompoundFormatTestCase;
@@ -60,6 +61,7 @@ public class TestLucene40CompoundFormat
     if (newDir instanceof MockDirectoryWrapper) {
       ((MockDirectoryWrapper)newDir).setEnableVirusScanner(false);
     }
+    int size = newDir.listAll().length;
     Lucene40CompoundReader csw = new Lucene40CompoundReader(newDir, "d.cfs", newIOContext(random()),
true);
     Lucene40CompoundReader nested = new Lucene40CompoundReader(newDir, "b.cfs", newIOContext(random()),
true);
     IndexOutput out = nested.createOutput("b.xyz", newIOContext(random()));
@@ -75,7 +77,7 @@ public class TestLucene40CompoundFormat
     newDir.deleteFile("b.cfe");
     csw.close();
     
-    assertEquals(2, newDir.listAll().length);
+    assertEquals(size+2, newDir.listAll().length);
     csw = new Lucene40CompoundReader(newDir, "d.cfs", newIOContext(random()), false);
     
     assertEquals(2, csw.listAll().length);
@@ -104,15 +106,11 @@ public class TestLucene40CompoundFormat
         os.writeInt(i*j);
       }
       os.close();
-      String[] listAll = newDir.listAll();
-      assertEquals(1, listAll.length);
-      assertEquals("d.cfs", listAll[0]);
+      assertTrue(Arrays.asList(newDir.listAll()).contains("d.cfs"));
     }
     createSequenceFile(dir, "d1", (byte) 0, 15);
     csw.copyFrom(dir, "d1", "d1", newIOContext(random()));
-    String[] listAll = newDir.listAll();
-    assertEquals(1, listAll.length);
-    assertEquals("d.cfs", listAll[0]);
+    assertTrue(Arrays.asList(newDir.listAll()).contains("d.cfs"));
     csw.close();
     
     Directory csr = new Lucene40CompoundReader(newDir, "d.cfs", newIOContext(random()), false);



Mime
View raw message