diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCompoundFile.java b/lucene/core/src/test/org/apache/lucene/index/TestCompoundFile.java index d07f271c3e4..704131f5633 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCompoundFile.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCompoundFile.java @@ -809,6 +809,11 @@ public class TestCompoundFile extends LuceneTestCase public void testListAll() throws Exception { Directory dir = newDirectory(); + if (dir instanceof MockDirectoryWrapper) { + // test lists files manually and tries to verify every .cfs it finds, + // but a virus scanner could leave some trash. + ((MockDirectoryWrapper)dir).setEnableVirusScanner(false); + } // riw should sometimes create docvalues fields, etc RandomIndexWriter riw = new RandomIndexWriter(random(), dir); Document doc = new Document();