lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1721365 [1/2] - in /lucene/dev/branches/lucene6835: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/ lucene/backward-codecs/src/test/org/apache/lucene/index/ lucene/core/src/java/org/apache/lucene/store/ lucene/core/src...
Date Tue, 22 Dec 2015 11:31:18 GMT
Author: mikemccand
Date: Tue Dec 22 11:31:17 2015
New Revision: 1721365

URL: http://svn.apache.org/viewvc?rev=1721365&view=rev
Log:
LUCENE-6835: exempt tests from virus checker if they do direct file deletes, or stop doing unnecessary direct file deletes; address some nocommits; fix compilation errors

Modified:
    lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
    lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
    lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
    lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
    lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
    lucene/dev/branches/lucene6835/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/Directory.java
    lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
    lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
    lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
    lucene/dev/branches/lucene6835/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
    lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
    lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
    lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
    lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
    lucene/dev/branches/lucene6835/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
    lucene/dev/branches/lucene6835/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
    lucene/dev/branches/lucene6835/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
    lucene/dev/branches/lucene6835/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
    lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
    lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
    lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
    lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
    lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
    lucene/dev/branches/lucene6835/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
    lucene/dev/branches/lucene6835/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
    lucene/dev/branches/lucene6835/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java

Modified: lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java (original)
+++ lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java Tue Dec 22 11:31:17 2015
@@ -55,7 +55,6 @@ public class Test64kAffixes extends Luce
     dictWriter.close();
     
     try (InputStream affStream = Files.newInputStream(affix); InputStream dictStream = Files.newInputStream(dict); Directory tempDir2 = newDirectory()) {
-      assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(tempDir2);
       Dictionary dictionary = new Dictionary(tempDir2, "dictionary", affStream, dictStream);
       Stemmer stemmer = new Stemmer(dictionary);
       // drinks should still stem to drink

Modified: lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java (original)
+++ lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java Tue Dec 22 11:31:17 2015
@@ -215,8 +215,6 @@ public class TestAllDictionaries extends
   }
 
   private Directory getDirectory() {
-    Directory dir = newDirectory();
-    assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(dir);
-    return dir;
+    return newDirectory();
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java (original)
+++ lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java Tue Dec 22 11:31:17 2015
@@ -189,7 +189,6 @@ public class TestAllDictionaries2 extend
         try (InputStream dictionary = Files.newInputStream(dicEntry);
              InputStream affix = Files.newInputStream(affEntry);
              Directory tempDir = newDirectory()) {
-          assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(tempDir);
           Dictionary dic = new Dictionary(tempDir, "dictionary", affix, dictionary);
           System.out.println(tests[i] + "\t" + RamUsageTester.humanSizeOf(dic) + "\t(" +
                              "words=" + RamUsageTester.humanSizeOf(dic.words) + ", " +
@@ -224,7 +223,6 @@ public class TestAllDictionaries2 extend
           try (InputStream dictionary = Files.newInputStream(dicEntry);
                InputStream affix = Files.newInputStream(affEntry);
                Directory tempDir = newDirectory()) {
-            assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(tempDir);
             new Dictionary(tempDir, "dictionary", affix, dictionary);
           } 
         }

Modified: lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java (original)
+++ lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java Tue Dec 22 11:31:17 2015
@@ -260,8 +260,6 @@ public class TestDictionary extends Luce
   }
 
   private Directory getDirectory() {
-    Directory dir = newDirectory();
-    assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(dir);
-    return dir;
+    return newDirectory();
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java (original)
+++ lucene/dev/branches/lucene6835/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java Tue Dec 22 11:31:17 2015
@@ -129,8 +129,6 @@ public class TestHunspellStemFilter exte
   }
 
   private static Directory getDirectory() {
-    Directory dir = newDirectory();
-    assumeFalse("test does direct file deletion", TestUtil.hasVirusChecker(dir);
-    return dir;
+    return newDirectory();
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/dev/branches/lucene6835/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Tue Dec 22 11:31:17 2015
@@ -1234,7 +1234,6 @@ public class TestBackwardsCompatibility
         System.out.println("testUpgradeOldSingleSegmentIndexWithAdditions: index=" +name);
       }
       Directory dir = newDirectory(oldIndexDirs.get(name));
-      assumeFalse("we need to ensure we delete old commits for this test, otherwise IndexUpgrader gets angry", TestUtil.hasVirusChecker(dir);
       assertEquals("Original index must be single segment", 1, getNumberOfSegments(dir));
 
       // create a bunch of dummy segments

Modified: lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/Directory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/Directory.java Tue Dec 22 11:31:17 2015
@@ -49,7 +49,8 @@ public abstract class Directory implemen
    */
   public abstract String[] listAll() throws IOException;
 
-  /** Removes the specified files from the directory. */
+  /** Removes the specified files from the directory.  If an exception is thrown, behavior is undefined
+   *  (none, some or all of the files may have in fact been deleted). */
   public abstract void deleteFiles(Collection<String> name) throws IOException;
 
   /**

Modified: lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java Tue Dec 22 11:31:17 2015
@@ -266,8 +266,6 @@ public abstract class FSDirectory extend
     }
   }
 
-  // nocommit openInput must refuse if it's a pending delete file?
-
   protected void ensureCanWrite(String name) throws IOException {
     deletePendingFiles();
     if (pendingDeletes.contains(name)) {
@@ -383,7 +381,6 @@ public abstract class FSDirectory extend
     // leave a corrupt commit in the index even in the presense of virus checkers:
     for(String fileName : toDelete) {
       if (fileName.startsWith(IndexFileNames.SEGMENTS) == false) {
-        // nocommit if we hit exc here ... should we continue deleting the rest, and do the addSuppressed thing...?
         deleteFile(fileName);
       }
     }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java Tue Dec 22 11:31:17 2015
@@ -165,7 +165,6 @@ public class RAMDirectory extends BaseDi
         file.directory = null;
         sizeInBytes.addAndGet(-file.sizeInBytes);
       } else {
-        // nocommit but should we keep trying to delete the rest, and throw this only at the end?
         throw new FileNotFoundException(name);
       }
     }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java Tue Dec 22 11:31:17 2015
@@ -179,6 +179,5 @@ public class TestAtomicUpdate extends Lu
     directory = newFSDirectory(dirPath);
     runTest(directory);
     directory.close();
-    IOUtils.rm(dirPath);
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java Tue Dec 22 11:31:17 2015
@@ -1094,8 +1094,6 @@ public class TestBinaryDocValuesUpdates
 
   public void testDeleteUnusedUpdatesFiles() throws Exception {
     Directory dir = newDirectory();
-    // nocommit try removing these ... often the test will be OK since Directory now "pretends" file was actually deleted
-    assumeFalse("test requires files are actually deleted", TestUtil.hasVirusChecker(dir));
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     IndexWriter writer = new IndexWriter(dir, conf);
     

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Tue Dec 22 11:31:17 2015
@@ -184,7 +184,6 @@ public class TestConcurrentMergeSchedule
 
   public void testNoExtraFiles() throws IOException {
     Directory directory = newDirectory();
-    assumeFalse("test uses IW unref'ed helper which is unaware of retries", TestUtil.hasVirusChecker(directory));
     IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(new MockAnalyzer(random()))
                                                       .setMaxBufferedDocs(2));
 

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java Tue Dec 22 11:31:17 2015
@@ -384,7 +384,7 @@ public class TestDemoParallelLeafReader
 
             final Directory dir = openDirectory(leafIndex);
 
-            if (Files.exists(leafIndex.resolve("done")) == false) {
+            if (slowFileExists(dir, "done") == false) {
               if (DEBUG) System.out.println(Thread.currentThread().getName() + ": TEST: build segment index for " + leaf + " " + segIDGen + " (source: " + info.getDiagnostics().get("source") + ") dir=" + leafIndex);
 
               if (dir.listAll().length != 0) {
@@ -895,7 +895,9 @@ public class TestDemoParallelLeafReader
     AtomicLong currentSchemaGen = new AtomicLong();
 
     // TODO: separate refresh thread, search threads, indexing threads
-    ReindexingReader reindexer = getReindexerNewDVFields(createTempDir(), currentSchemaGen);
+    Path root = createTempDir();
+    assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
+    ReindexingReader reindexer = getReindexerNewDVFields(root, currentSchemaGen);
     reindexer.commit();
 
     Document doc = new Document();
@@ -965,6 +967,7 @@ public class TestDemoParallelLeafReader
     int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
     int maxID = 0;
     Path root = createTempDir();
+    assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
     int refreshEveryNumDocs = 100;
     int commitCloseNumDocs = 1000;
     for(int i=0;i<numDocs;i++) {
@@ -1050,6 +1053,7 @@ public class TestDemoParallelLeafReader
     int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
     int maxID = 0;
     Path root = createTempDir();
+    assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
     int refreshEveryNumDocs = 100;
     int commitCloseNumDocs = 1000;
 
@@ -1151,7 +1155,9 @@ public class TestDemoParallelLeafReader
   }
 
   public void testBasic() throws Exception {
-    ReindexingReader reindexer = getReindexer(createTempDir());
+    Path tempPath = createTempDir();
+    assumeFalse("we directly delete files", TestUtil.hasVirusChecker(tempPath));
+    ReindexingReader reindexer = getReindexer(tempPath);
 
     // Start with initial empty commit:
     reindexer.commit();
@@ -1220,6 +1226,7 @@ public class TestDemoParallelLeafReader
 
   public void testRandom() throws Exception {
     Path root = createTempDir();
+    assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
     ReindexingReader reindexer = null;
 
     // TODO: separate refresh thread, search threads, indexing threads

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java Tue Dec 22 11:31:17 2015
@@ -436,40 +436,43 @@ void assertTermDocsCount(String msg,
     rmDir(fileDirName);
   }*/
   
-public void testFilesOpenClose() throws IOException {
-      // Create initial data set
-      Path dirFile = createTempDir("TestIndexReader.testFilesOpenClose");
-      Directory dir = newFSDirectory(dirFile);
-      IndexWriter writer  = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-      addDoc(writer, "test");
-      writer.close();
-      dir.close();
-
-      // Try to erase the data - this ensures that the writer closed all files
-      IOUtils.rm(dirFile);
-      dir = newFSDirectory(dirFile);
-
-      // Now create the data set again, just as before
-      writer  = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
-                                       .setOpenMode(OpenMode.CREATE));
-      addDoc(writer, "test");
-      writer.close();
-      dir.close();
-
-      // Now open existing directory and test that reader closes all files
-      dir = newFSDirectory(dirFile);
-      DirectoryReader reader1 = DirectoryReader.open(dir);
-      reader1.close();
-      dir.close();
-
-      // The following will fail if reader did not close
-      // all files
-      IOUtils.rm(dirFile);
+  public void testFilesOpenClose() throws IOException {
+    // Create initial data set
+    Path dirFile = createTempDir("TestIndexReader.testFilesOpenClose");
+    assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(dirFile));
+    Directory dir = newFSDirectory(dirFile);
+    
+    IndexWriter writer  = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+    addDoc(writer, "test");
+    writer.close();
+    dir.close();
+
+    // Try to erase the data - this ensures that the writer closed all files
+    IOUtils.rm(dirFile);
+    dir = newFSDirectory(dirFile);
+
+    // Now create the data set again, just as before
+    writer  = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+                              .setOpenMode(OpenMode.CREATE));
+    addDoc(writer, "test");
+    writer.close();
+    dir.close();
+
+    // Now open existing directory and test that reader closes all files
+    dir = newFSDirectory(dirFile);
+    DirectoryReader reader1 = DirectoryReader.open(dir);
+    reader1.close();
+    dir.close();
+
+    // The following will fail if reader did not close
+    // all files
+    IOUtils.rm(dirFile);
   }
 
   public void testOpenReaderAfterDelete() throws IOException {
     Path dirFile = createTempDir("deletetest");
     Directory dir = newFSDirectory(dirFile);
+    assumeFalse("test deletes files directly", TestUtil.hasVirusChecker(dir));
     if (dir instanceof BaseDirectoryWrapper) {
       ((BaseDirectoryWrapper)dir).setCheckIndexOnClose(false); // we will hit NoSuchFileException in MDW since we nuked it!
     }
@@ -717,7 +720,6 @@ public void testFilesOpenClose() throws
   // good exception
   public void testNoDir() throws Throwable {
     Path tempDir = createTempDir("doesnotexist");
-    IOUtils.rm(tempDir);
     Directory dir = newFSDirectory(tempDir);
     try {
       DirectoryReader.open(dir);

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java Tue Dec 22 11:31:17 2015
@@ -624,7 +624,6 @@ public class TestDirectoryReaderReopen e
 
   public void testOverDecRefDuringReopen() throws Exception {
     MockDirectoryWrapper dir = newMockDirectory();
-    assumeFalse("ensure we produce enough of our exceptions", TestUtil.hasVirusChecker(dir));
 
     IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
     iwc.setCodec(TestUtil.getDefaultCodec());

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDoc.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestDoc.java Tue Dec 22 11:31:17 2015
@@ -121,7 +121,6 @@ public class TestDoc extends LuceneTestC
       // We create unreferenced files (we don't even write
       // a segments file):
       ((MockDirectoryWrapper) directory).setAssertNoUnrefencedFilesOnClose(false);
-      assumeFalse("this test itself deletes files (has no retry mechanism)", TestUtil.hasVirusChecker(directory));
     }
 
     IndexWriter writer = new IndexWriter(
@@ -164,7 +163,6 @@ public class TestDoc extends LuceneTestC
       // We create unreferenced files (we don't even write
       // a segments file):
       ((MockDirectoryWrapper) directory).setAssertNoUnrefencedFilesOnClose(false);
-      assumeFalse("this test itself deletes files (has no retry mechanism)", TestUtil.hasVirusChecker(directory));
     }
 
     writer = new IndexWriter(

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java Tue Dec 22 11:31:17 2015
@@ -188,42 +188,37 @@ public class TestFieldsReader extends Lu
   public void testExceptions() throws Throwable {
     Path indexDir = createTempDir("testfieldswriterexceptions");
 
-    try {
-      Directory fsDir = newFSDirectory(indexDir);
-      FaultyFSDirectory dir = new FaultyFSDirectory(fsDir);
-      IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()))
-                                .setOpenMode(OpenMode.CREATE);
-      IndexWriter writer = new IndexWriter(dir, iwc);
-      for(int i=0;i<2;i++)
-        writer.addDocument(testDoc);
-      writer.forceMerge(1);
-      writer.close();
+    Directory fsDir = newFSDirectory(indexDir);
+    FaultyFSDirectory dir = new FaultyFSDirectory(fsDir);
+    IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()))
+      .setOpenMode(OpenMode.CREATE);
+    IndexWriter writer = new IndexWriter(dir, iwc);
+    for(int i=0;i<2;i++)
+      writer.addDocument(testDoc);
+    writer.forceMerge(1);
+    writer.close();
 
-      IndexReader reader = DirectoryReader.open(dir);
-      dir.startFailing();
+    IndexReader reader = DirectoryReader.open(dir);
+    dir.startFailing();
 
-      boolean exc = false;
+    boolean exc = false;
 
-      for(int i=0;i<2;i++) {
-        try {
-          reader.document(i);
-        } catch (IOException ioe) {
-          // expected
-          exc = true;
-        }
-        try {
-          reader.document(i);
-        } catch (IOException ioe) {
-          // expected
-          exc = true;
-        }
+    for(int i=0;i<2;i++) {
+      try {
+        reader.document(i);
+      } catch (IOException ioe) {
+        // expected
+        exc = true;
+      }
+      try {
+        reader.document(i);
+      } catch (IOException ioe) {
+        // expected
+        exc = true;
       }
-      assertTrue(exc);
-      reader.close();
-      dir.close();
-    } finally {
-      IOUtils.rm(indexDir);
     }
-
+    assertTrue(exc);
+    reader.close();
+    dir.close();
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java Tue Dec 22 11:31:17 2015
@@ -47,7 +47,6 @@ public class TestIndexFileDeleter extend
     Directory dir = newDirectory();
     if (dir instanceof MockDirectoryWrapper) {
       ((MockDirectoryWrapper)dir).setPreventDoubleWrite(false);
-      assumeFalse("ensure we actually delete files", TestUtil.hasVirusChecker(dir));
     }
 
     MergePolicy mergePolicy = newLogMergePolicy(true, 10);
@@ -222,7 +221,6 @@ public class TestIndexFileDeleter extend
   public void testVirusScannerDoesntCorruptIndex() throws IOException {
     MockDirectoryWrapper dir = newMockDirectory();
     dir.setPreventDoubleWrite(false); // we arent trying to test this
-    assumeFalse("we have our own to make test reproduce always", TestUtil.hasVirusChecker(dir));
     
     // add empty commit
     new IndexWriter(dir, new IndexWriterConfig(null)).close();

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Tue Dec 22 11:31:17 2015
@@ -1267,6 +1267,7 @@ public class TestIndexWriter extends Luc
     for(int iter=0;iter<2;iter++) {
       // relies on windows semantics
       Path path = createTempDir();
+      assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(path));
       FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///"));
       Path indexPath = new FilterPath(path, fs);
 
@@ -1351,7 +1352,6 @@ public class TestIndexWriter extends Luc
     // Validates that iw.deleteUnusedFiles() also deletes unused index commits
     // in case a deletion policy which holds onto commits is used.
     Directory dir = newDirectory();
-    assumeFalse("otherwise the delete of old commit might not actually succeed temporarily", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
                                                 .setIndexDeletionPolicy(new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy())));
     SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
@@ -1404,7 +1404,6 @@ public class TestIndexWriter extends Luc
     // indexed, flushed (but not committed) and then IW rolls back, then no
     // files are left in the Directory.
     Directory dir = newDirectory();
-    assumeFalse("must delete files", TestUtil.hasVirusChecker(dir));
     
     String[] origFiles = dir.listAll();
     IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
@@ -1469,7 +1468,6 @@ public class TestIndexWriter extends Luc
   public void testNoUnwantedTVFiles() throws Exception {
 
     Directory dir = newDirectory();
-    assumeFalse("test uses IW unref'ed check which is unaware of retries", TestUtil.hasVirusChecker(dir));
     IndexWriter indexWriter = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
                                                      .setRAMBufferSizeMB(0.01)
                                                      .setMergePolicy(newLogMergePolicy()));
@@ -1635,7 +1633,6 @@ public class TestIndexWriter extends Luc
   public void testDeleteAllNRTLeftoverFiles() throws Exception {
 
     MockDirectoryWrapper d = new MockDirectoryWrapper(random(), new RAMDirectory());
-    assumeFalse("needs for files to actually be deleted", TestUtil.hasVirusChecker(d));
     IndexWriter w = new IndexWriter(d, new IndexWriterConfig(new MockAnalyzer(random())));
     Document doc = new Document();
     for(int i = 0; i < 20; i++) {
@@ -1758,7 +1755,6 @@ public class TestIndexWriter extends Luc
   // LUCENE-3872
   public void testPrepareCommitThenRollback() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("indexExists might return true if virus scanner prevents deletions", TestUtil.hasVirusChecker(dir));
     IndexWriter w = new IndexWriter(dir,
                                     new IndexWriterConfig(new MockAnalyzer(random())));
 

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java Tue Dec 22 11:31:17 2015
@@ -94,7 +94,6 @@ public class TestIndexWriterCommit exten
    */
   public void testCommitOnCloseAbort() throws IOException {
     Directory dir = newDirectory();
-    assumeFalse("test uses IW unref'ed check which is unaware of retries", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
                                                 .setMaxBufferedDocs(10));
     for (int i = 0; i < 14; i++) {
@@ -186,7 +185,6 @@ public class TestIndexWriterCommit exten
     final String contentFormat = TestUtil.getPostingsFormat("content");
     assumeFalse("This test cannot run with Memory codec", idFormat.equals("Memory") || contentFormat.equals("Memory"));
     MockDirectoryWrapper dir = newMockDirectory();
-    assumeFalse("the virus scanner can use up too much disk space", TestUtil.hasVirusChecker(dir));
     Analyzer analyzer;
     if (random().nextBoolean()) {
       // no payloads
@@ -272,7 +270,6 @@ public class TestIndexWriterCommit exten
     if (dir instanceof MockDirectoryWrapper) {
       ((MockDirectoryWrapper)dir).setPreventDoubleWrite(false);
     }
-    assumeFalse("test uses IW unref'ed check which is unaware of retries", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(
         dir,
         newIndexWriterConfig(new MockAnalyzer(random()))
@@ -589,7 +586,6 @@ public class TestIndexWriterCommit exten
     IndexReader reader2 = DirectoryReader.open(dir);
     assertEquals(0, reader2.numDocs());
 
-    assumeFalse("We need to let IW delete the partial segments_N that was written in prepareCommit, else we get a false fail below", TestUtil.hasVirusChecker(mockDir));
     writer.rollback();
 
     IndexReader reader3 = DirectoryReader.openIfChanged(reader);

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Tue Dec 22 11:31:17 2015
@@ -498,7 +498,6 @@ public class TestIndexWriterDelete exten
 
     // First build up a starting index:
     MockDirectoryWrapper startDir = newMockDirectory();
-    assumeFalse("test uses IW unref'ed helper which is unaware of retries", TestUtil.hasVirusChecker(startDir));
 
     IndexWriter writer = new IndexWriter(startDir, newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
     for (int i = 0; i < 157; i++) {
@@ -525,7 +524,6 @@ public class TestIndexWriterDelete exten
       MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), TestUtil.ramCopyOf(startDir));
       dir.setPreventDoubleWrite(false);
       dir.setAllowRandomFileNotFoundException(false);
-      assumeFalse("test uses IW unref'ed helper which is unaware of retries", TestUtil.hasVirusChecker(dir));
       IndexWriter modifier = new IndexWriter(dir,
                                              newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false))
                                              .setMaxBufferedDocs(1000)
@@ -910,7 +908,6 @@ public class TestIndexWriterDelete exten
     String[] text = { "Amsterdam", "Venice" };
 
     MockDirectoryWrapper dir = newMockDirectory();
-    assumeFalse("test uses IW unref'ed helper which is unaware of retries", TestUtil.hasVirusChecker(dir));
     IndexWriter modifier = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
     modifier.commit();
     dir.failOn(failure.reset());

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java Tue Dec 22 11:31:17 2015
@@ -949,7 +949,6 @@ public class TestIndexWriterExceptions e
     for (FailOnlyInCommit failure : failures) {
       MockDirectoryWrapper dir = newMockDirectory();
       dir.setFailOnCreateOutput(false);
-      assumeFalse("we check for specific list of files", TestUtil.hasVirusChecker(dir));
       int fileCount = dir.listAll().length;
       IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
       Document doc = new Document();
@@ -1177,7 +1176,6 @@ public class TestIndexWriterExceptions e
   public void testSimulatedCorruptIndex1() throws IOException {
       BaseDirectoryWrapper dir = newDirectory();
       dir.setCheckIndexOnClose(false); // we are corrupting it!
-      assumeFalse("we want to ensure our corruption always succeeds!", TestUtil.hasVirusChecker(dir));
 
       IndexWriter writer = null;
 
@@ -1226,7 +1224,6 @@ public class TestIndexWriterExceptions e
   public void testSimulatedCorruptIndex2() throws IOException {
     BaseDirectoryWrapper dir = newDirectory();
     dir.setCheckIndexOnClose(false); // we are corrupting it!
-    assumeFalse("we want to ensure our corruption always succeeds!", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = null;
 
     writer  = new IndexWriter(

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java Tue Dec 22 11:31:17 2015
@@ -126,7 +126,6 @@ public class TestIndexWriterForceMerge e
   public void testForceMergeTempSpaceUsage() throws IOException {
 
     final MockDirectoryWrapper dir = newMockDirectory();
-    assumeFalse("deletes must succeed else too much disk is used", TestUtil.hasVirusChecker(dir));
     // don't use MockAnalyzer, variable length payloads can cause merge to make things bigger,
     // since things are optimized for fixed length case. this is a problem for MemoryPF's encoding.
     // (it might have other problems too)

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java Tue Dec 22 11:31:17 2015
@@ -112,7 +112,6 @@ public class TestIndexWriterFromReader e
   // Pull NRT reader after writer has committed and then indexed another doc:
   public void testAfterCommitThenIndex() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("We only hit exc if stale segments file was deleted", TestUtil.hasVirusChecker(dir));
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig());
     w.addDocument(new Document());
     w.commit();
@@ -138,7 +137,6 @@ public class TestIndexWriterFromReader e
   // NRT rollback: pull NRT reader after writer has committed and then before indexing another doc
   public void testNRTRollback() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("We only hit exc if stale segments file was deleted", TestUtil.hasVirusChecker(dir));
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig());
     w.addDocument(new Document());
     w.commit();

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java Tue Dec 22 11:31:17 2015
@@ -63,7 +63,6 @@ public class TestIndexWriterOnDiskFull e
           System.out.println("TEST: cycle: diskFree=" + diskFree);
         }
         MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), new RAMDirectory());
-        assumeFalse("currently uses the IW unreferenced files method, unaware of retries", TestUtil.hasVirusChecker(dir));
         dir.setMaxSizeInBytes(diskFree);
         IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
         MergeScheduler ms = writer.getConfig().getMergeScheduler();

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java Tue Dec 22 11:31:17 2015
@@ -42,8 +42,6 @@ public class TestNRTReaderCleanup extend
 
     MockDirectoryWrapper dir = newMockDirectory();
     
-    assumeFalse("don't act like windows either, or the test won't simulate the condition", TestUtil.hasVirusChecker(dir));
-
     // Allow writing to same file more than once:
     dir.setPreventDoubleWrite(false);
 

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java Tue Dec 22 11:31:17 2015
@@ -101,7 +101,5 @@ public class TestNeverDelete extends Luc
     }
     w.close();
     d.close();
-
-    IOUtils.rm(tmpDir);
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java Tue Dec 22 11:31:17 2015
@@ -1182,7 +1182,6 @@ public class TestNumericDocValuesUpdates
   @Test
   public void testDeleteUnusedUpdatesFiles() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("test explicitly needs files to always be actually deleted", TestUtil.hasVirusChecker(dir));
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     IndexWriter writer = new IndexWriter(dir, conf);
     

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java Tue Dec 22 11:31:17 2015
@@ -189,7 +189,6 @@ public class TestOmitPositions extends L
   // Verifies no *.prx exists when all fields omit term positions:
   public void testNoPrxFile() throws Throwable {
     Directory ram = newDirectory();
-    assumeFalse("we verify some files get deleted", TestUtil.hasVirusChecker(ram));
 
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriter writer = new IndexWriter(ram, newIndexWriterConfig(analyzer)

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java Tue Dec 22 11:31:17 2015
@@ -220,7 +220,6 @@ public class TestOmitTf extends LuceneTe
   // Verifies no *.prx exists when all fields omit term freq:
   public void testNoPrxFile() throws Throwable {
     Directory ram = newDirectory();
-    assumeFalse("we verify some files get deleted", TestUtil.hasVirusChecker(ram));
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriter writer = new IndexWriter(ram, newIndexWriterConfig(analyzer)
                                                 .setMaxBufferedDocs(3)

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java Tue Dec 22 11:31:17 2015
@@ -51,7 +51,6 @@ public class TestPersistentSnapshotDelet
   public void testExistingSnapshots() throws Exception {
     int numSnapshots = 3;
     MockDirectoryWrapper dir = newMockDirectory();
-    assumeFalse("test relies on files actually being deleted", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy(dir)));
     PersistentSnapshotDeletionPolicy psdp = (PersistentSnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
     assertNull(psdp.getLastSaveFile());

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java Tue Dec 22 11:31:17 2015
@@ -39,7 +39,6 @@ public class TestRollingUpdates extends
   public void testRollingUpdates() throws Exception {
     Random random = new Random(random().nextLong());
     final BaseDirectoryWrapper dir = newDirectory();
-    assumeFalse("test checks for no unref'ed files with the IW helper method, which isn't aware of 'tried to delete files'", TestUtil.hasVirusChecker(dir));
     
     final LineFileDocs docs = new LineFileDocs(random, true);
 

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java Tue Dec 22 11:31:17 2015
@@ -104,7 +104,6 @@ public class TestSnapshotDeletionPolicy
   }
 
   private void runTest(Random random, Directory dir) throws Exception {
-    assumeFalse("we use the IW unref'ed files check which is unaware of retries:", TestUtil.hasVirusChecker(dir));
     // Run for ~1 seconds
     final long stopTime = System.currentTimeMillis() + 1000;
 
@@ -255,7 +254,6 @@ public class TestSnapshotDeletionPolicy
     
     // Create 3 snapshots: snapshot0, snapshot1, snapshot2
     Directory dir = newDirectory();
-    assumeFalse("we verify some files get deleted", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
     SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
     prepareIndexAndSnapshots(sdp, writer, numSnapshots);
@@ -280,7 +278,6 @@ public class TestSnapshotDeletionPolicy
   @Test
   public void testMultiThreadedSnapshotting() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("test relies on files actually being deleted", TestUtil.hasVirusChecker(dir));
 
     final IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
     final SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
@@ -357,7 +354,6 @@ public class TestSnapshotDeletionPolicy
   @Test
   public void testReleaseSnapshot() throws Exception {
     Directory dir = newDirectory();
-    assumeFalse("we rely upon existence of files", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
     SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
     prepareIndexAndSnapshots(sdp, writer, 1);
@@ -407,7 +403,6 @@ public class TestSnapshotDeletionPolicy
     // Tests the behavior of SDP when commits that are given at ctor are missing
     // on onInit().
     Directory dir = newDirectory();
-    assumeFalse("we rely upon existence of files", TestUtil.hasVirusChecker(dir));
     IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
     SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
     writer.addDocument(new Document());

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java Tue Dec 22 11:31:17 2015
@@ -211,58 +211,54 @@ public class TestBufferedIndexInput exte
     public void testSetBufferSize() throws IOException {
       Path indexDir = createTempDir("testSetBufferSize");
       MockFSDirectory dir = new MockFSDirectory(indexDir, random());
-      try {
-        IndexWriter writer = new IndexWriter(
-            dir,
-            new IndexWriterConfig(new MockAnalyzer(random())).
-                setOpenMode(OpenMode.CREATE).
-                setMergePolicy(newLogMergePolicy(false))
-        );
-        for(int i=0;i<37;i++) {
-          Document doc = new Document();
-          doc.add(newTextField("content", "aaa bbb ccc ddd" + i, Field.Store.YES));
-          doc.add(newTextField("id", "" + i, Field.Store.YES));
-          writer.addDocument(doc);
-        }
+      IndexWriter writer = new IndexWriter(
+                                           dir,
+                                           new IndexWriterConfig(new MockAnalyzer(random())).
+                                           setOpenMode(OpenMode.CREATE).
+                                           setMergePolicy(newLogMergePolicy(false))
+                                           );
+      for(int i=0;i<37;i++) {
+        Document doc = new Document();
+        doc.add(newTextField("content", "aaa bbb ccc ddd" + i, Field.Store.YES));
+        doc.add(newTextField("id", "" + i, Field.Store.YES));
+        writer.addDocument(doc);
+      }
 
-        dir.allIndexInputs.clear();
+      dir.allIndexInputs.clear();
 
-        IndexReader reader = DirectoryReader.open(writer, true);
-        Term aaa = new Term("content", "aaa");
-        Term bbb = new Term("content", "bbb");
+      IndexReader reader = DirectoryReader.open(writer, true);
+      Term aaa = new Term("content", "aaa");
+      Term bbb = new Term("content", "bbb");
         
-        reader.close();
+      reader.close();
         
-        dir.tweakBufferSizes();
-        writer.deleteDocuments(new Term("id", "0"));
-        reader = DirectoryReader.open(writer, true);
-        IndexSearcher searcher = newSearcher(reader);
-        ScoreDoc[] hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
-        dir.tweakBufferSizes();
-        assertEquals(36, hits.length);
+      dir.tweakBufferSizes();
+      writer.deleteDocuments(new Term("id", "0"));
+      reader = DirectoryReader.open(writer, true);
+      IndexSearcher searcher = newSearcher(reader);
+      ScoreDoc[] hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
+      dir.tweakBufferSizes();
+      assertEquals(36, hits.length);
         
-        reader.close();
+      reader.close();
         
-        dir.tweakBufferSizes();
-        writer.deleteDocuments(new Term("id", "4"));
-        reader = DirectoryReader.open(writer, true);
-        searcher = newSearcher(reader);
+      dir.tweakBufferSizes();
+      writer.deleteDocuments(new Term("id", "4"));
+      reader = DirectoryReader.open(writer, true);
+      searcher = newSearcher(reader);
 
-        hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
-        dir.tweakBufferSizes();
-        assertEquals(35, hits.length);
-        dir.tweakBufferSizes();
-        hits = searcher.search(new TermQuery(new Term("id", "33")), 1000).scoreDocs;
-        dir.tweakBufferSizes();
-        assertEquals(1, hits.length);
-        hits = searcher.search(new TermQuery(aaa), 1000).scoreDocs;
-        dir.tweakBufferSizes();
-        assertEquals(35, hits.length);
-        writer.close();
-        reader.close();
-      } finally {
-        IOUtils.rm(indexDir);
-      }
+      hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
+      dir.tweakBufferSizes();
+      assertEquals(35, hits.length);
+      dir.tweakBufferSizes();
+      hits = searcher.search(new TermQuery(new Term("id", "33")), 1000).scoreDocs;
+      dir.tweakBufferSizes();
+      assertEquals(1, hits.length);
+      hits = searcher.search(new TermQuery(aaa), 1000).scoreDocs;
+      dir.tweakBufferSizes();
+      assertEquals(35, hits.length);
+      writer.close();
+      reader.close();
     }
 
     private static class MockFSDirectory extends FilterDirectory {

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java Tue Dec 22 11:31:17 2015
@@ -26,6 +26,7 @@ import java.util.List;
 
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
 
 public class TestDirectory extends LuceneTestCase {
 
@@ -33,6 +34,7 @@ public class TestDirectory extends Lucen
   // path, can read, write, and lock files.
   public void testDirectInstantiation() throws Exception {
     final Path path = createTempDir("testDirectInstantiation");
+    assumeFalse("test deletes files through different FSDir instances", TestUtil.hasVirusChecker(path));
     
     final byte[] largeBuffer = new byte[random().nextInt(256*1024)], largeReadBuffer = new byte[largeBuffer.length];
     for (int i = 0; i < largeBuffer.length; i++) {
@@ -111,23 +113,17 @@ public class TestDirectory extends Lucen
       dir.close();
       assertFalse(dir.isOpen);
     }
-    
-    IOUtils.rm(path);
   }
 
   // LUCENE-1468
   @SuppressWarnings("resource")
   public void testCopySubdir() throws Throwable {
     Path path = createTempDir("testsubdir");
-    try {
-      Files.createDirectory(path.resolve("subdir"));
-      FSDirectory fsDir = new SimpleFSDirectory(path);
-      RAMDirectory ramDir = new RAMDirectory(fsDir, newIOContext(random()));
-      List<String> files = Arrays.asList(ramDir.listAll());
-      assertFalse(files.contains("subdir"));
-    } finally {
-      IOUtils.rm(path);
-    }
+    Files.createDirectory(path.resolve("subdir"));
+    FSDirectory fsDir = new SimpleFSDirectory(path);
+    RAMDirectory ramDir = new RAMDirectory(fsDir, newIOContext(random()));
+    List<String> files = Arrays.asList(ramDir.listAll());
+    assertFalse(files.contains("subdir"));
   }
 
   // LUCENE-1468
@@ -146,7 +142,6 @@ public class TestDirectory extends Lucen
       }
     } finally {
       fsDir.close();
-      IOUtils.rm(path);
     }
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java Tue Dec 22 11:31:17 2015
@@ -100,7 +100,6 @@ public class TestFileSwitchDirectory ext
   public void testNoDir() throws Throwable {
     Path primDir = createTempDir("foo");
     Path secondDir = createTempDir("bar");
-    IOUtils.rm(primDir, secondDir);
     Directory dir = newFSSwitchDirectory(primDir, secondDir, Collections.<String>emptySet());
     try {
       DirectoryReader.open(dir);

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java Tue Dec 22 11:31:17 2015
@@ -23,6 +23,7 @@ import java.nio.file.Path;
 import java.util.Collections;
 
 import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.TestUtil;
 
 /** Simple tests for NativeFSLockFactory */
 public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
@@ -80,19 +81,15 @@ public class TestNativeFSLockFactory ext
   
   /** delete the lockfile and test ensureValid fails */
   public void testDeleteLockFile() throws IOException {
-    Directory dir = getDirectory(createTempDir());
-    try {
+    try (Directory dir = getDirectory(createTempDir())) {
+      assumeFalse("we must be able to delete an open file", TestUtil.hasWindowsFS(dir));
+      assumeFalse("we must be able to delete an open file", TestUtil.hasVirusChecker(dir));
+
       Lock lock = dir.obtainLock("test.lock");
       lock.ensureValid();
-    
-      try {
-        dir.deleteFiles(Collections.singleton("test.lock"));
-      } catch (Exception e) {
-        // we can't delete a file for some reason, just clean up and assume the test.
-        IOUtils.closeWhileHandlingException(lock);
-        assumeNoException("test requires the ability to delete a locked file", e);
-      }
-    
+
+      dir.deleteFiles(Collections.singleton("test.lock"));
+
       try {
         lock.ensureValid();
         fail("no exception");
@@ -101,9 +98,6 @@ public class TestNativeFSLockFactory ext
       } finally {
         IOUtils.closeWhileHandlingException(lock);
       }
-    } finally {
-      // Do this in finally clause in case the assumeNoException is false:
-      dir.close();
     }
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java Tue Dec 22 11:31:17 2015
@@ -83,7 +83,6 @@ public class TestRAMDirectory extends Ba
       assertFalse(files.contains("subdir"));
     } finally {
       IOUtils.close(fsDir);
-      IOUtils.rm(path);
     }
   }
 

Modified: lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java (original)
+++ lucene/dev/branches/lucene6835/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java Tue Dec 22 11:31:17 2015
@@ -22,6 +22,7 @@ import java.nio.file.Path;
 import java.util.Collections;
 
 import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.TestUtil;
 
 /** Simple tests for SimpleFSLockFactory */
 public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
@@ -35,6 +36,7 @@ public class TestSimpleFSLockFactory ext
   public void testDeleteLockFile() throws IOException {
     Directory dir = getDirectory(createTempDir());
     try {
+      assumeFalse("test directly deletes lock files", TestUtil.hasVirusChecker(dir));
       Lock lock = dir.obtainLock("test.lock");
       lock.ensureValid();
     

Modified: lucene/dev/branches/lucene6835/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java (original)
+++ lucene/dev/branches/lucene6835/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java Tue Dec 22 11:31:17 2015
@@ -46,7 +46,6 @@ public class TestFSTsMisc extends Lucene
     super.setUp();
     dir = newMockDirectory();
     dir.setPreventDoubleWrite(false);
-    dir.setEnableVirusScanner(false);
   }
 
   @Override

Modified: lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java (original)
+++ lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java Tue Dec 22 11:31:17 2015
@@ -22,6 +22,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.file.Path;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -424,22 +425,6 @@ public class IndexAndTaxonomyReplication
               }
             }
 
-            if (indexStatus == null || indexStatus.clean == false) {
-
-              // Because segments file for taxo index is replicated after
-              // main index's segments file, if there's an error while replicating
-              // main index's segments file and if virus checker prevents
-              // deletion of taxo index's segments file, it can look like corruption.
-              // But it should be "false" meaning if we remove the latest segments
-              // file then the index is intact.  It's like pulling a hideous
-              // looking rock out of the ground, but then you pull the cruft
-              // off the outside of it and discover it's actually a beautiful
-              // diamond:
-              String segmentsFileName = SegmentInfos.getLastCommitSegmentsFileName(handlerTaxoDir);
-              assertTrue(handlerTaxoDir.didTryToDelete(segmentsFileName));
-              handlerTaxoDir.getDelegate().deleteFile(segmentsFileName);
-              TestUtil.checkIndex(handlerTaxoDir.getDelegate());
-            }
           } catch (IOException e) {
             failed.set(true);
             throw new RuntimeException(e);

Modified: lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java (original)
+++ lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java Tue Dec 22 11:31:17 2015
@@ -77,10 +77,6 @@ public class IndexAndTaxonomyRevisionTes
     
     Directory taxoDir = newDirectory();
     SnapshotDirectoryTaxonomyWriter taxoWriter = new SnapshotDirectoryTaxonomyWriter(taxoDir);
-    // we look to see that certain files are deleted:
-    if (indexDir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper)indexDir).setEnableVirusScanner(false);
-    }
     try {
       indexWriter.addDocument(newDocument(taxoWriter));
       indexWriter.commit();
@@ -101,10 +97,6 @@ public class IndexAndTaxonomyRevisionTes
       indexWriter.close();
     } finally {
       IOUtils.close(indexWriter, taxoWriter, taxoDir, indexDir);
-      if (indexDir instanceof MockDirectoryWrapper) {
-        // set back to on for other tests
-        ((MockDirectoryWrapper)indexDir).setEnableVirusScanner(true);
-      }
     }
   }
   

Modified: lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java (original)
+++ lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java Tue Dec 22 11:31:17 2015
@@ -73,10 +73,6 @@ public class IndexRevisionTest extends R
   @Test
   public void testRevisionRelease() throws Exception {
     Directory dir = newDirectory();
-    // we look to see that certain files are deleted:
-    if (dir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
-    }
     IndexWriterConfig conf = new IndexWriterConfig(null);
     conf.setIndexDeletionPolicy(new SnapshotDeletionPolicy(conf.getIndexDeletionPolicy()));
     IndexWriter writer = new IndexWriter(dir, conf);

Modified: lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java (original)
+++ lucene/dev/branches/lucene6835/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java Tue Dec 22 11:31:17 2015
@@ -119,57 +119,35 @@ public class LocalReplicatorTest extends
   
   @Test
   public void testPublishSameRevision() throws IOException {
-    // we look to see that certain files are deleted:
-    if (sourceDir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
-    }
-    try {
-      Revision rev = createRevision(1);
-      replicator.publish(rev);
-      SessionToken res = replicator.checkForUpdate(null);
-      assertNotNull(res);
-      assertEquals(rev.getVersion(), res.version);
-      replicator.release(res.id);
-      replicator.publish(new IndexRevision(sourceWriter));
-      res = replicator.checkForUpdate(res.version);
-      assertNull(res);
+    Revision rev = createRevision(1);
+    replicator.publish(rev);
+    SessionToken res = replicator.checkForUpdate(null);
+    assertNotNull(res);
+    assertEquals(rev.getVersion(), res.version);
+    replicator.release(res.id);
+    replicator.publish(new IndexRevision(sourceWriter));
+    res = replicator.checkForUpdate(res.version);
+    assertNull(res);
       
-      // now make sure that publishing same revision doesn't leave revisions
-      // "locked", i.e. that replicator releases revisions even when they are not
-      // kept
-      replicator.publish(createRevision(2));
-      assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
-    } finally {
-      if (sourceDir instanceof MockDirectoryWrapper) {
-        // set back to on for other tests
-        ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
-      }
-    }
+    // now make sure that publishing same revision doesn't leave revisions
+    // "locked", i.e. that replicator releases revisions even when they are not
+    // kept
+    replicator.publish(createRevision(2));
+    assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
   }
   
   @Test
   public void testPublishOlderRev() throws IOException {
-    // we look to see that certain files are deleted:
-    if (sourceDir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
-    }
+    replicator.publish(createRevision(1));
+    Revision old = new IndexRevision(sourceWriter);
+    replicator.publish(createRevision(2));
     try {
-      replicator.publish(createRevision(1));
-      Revision old = new IndexRevision(sourceWriter);
-      replicator.publish(createRevision(2));
-      try {
-        replicator.publish(old);
-        fail("should have failed to publish an older revision");
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
-      assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
-    } finally {
-      if (sourceDir instanceof MockDirectoryWrapper) {
-        // set back to on for other tests
-        ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
-      }
+      replicator.publish(old);
+      fail("should have failed to publish an older revision");
+    } catch (IllegalArgumentException e) {
+      // expected
     }
+    assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
   }
   
   @Test
@@ -210,24 +188,12 @@ public class LocalReplicatorTest extends
   
   @Test
   public void testRevisionRelease() throws Exception {
-    // we look to see that certain files are deleted:
-    if (sourceDir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
-    }
-    
-    try {
-      replicator.publish(createRevision(1));
-      assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
-      replicator.publish(createRevision(2));
-      // now the files of revision 1 can be deleted
-      assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_2"));
-      assertFalse("segments_1 should not be found in index directory after revision is released", slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
-    } finally {
-      if (sourceDir instanceof MockDirectoryWrapper) {
-        // set back to on for other tests
-        ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
-      }
-    }
+    replicator.publish(createRevision(1));
+    assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
+    replicator.publish(createRevision(2));
+    // now the files of revision 1 can be deleted
+    assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_2"));
+    assertFalse("segments_1 should not be found in index directory after revision is released", slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
   }
   
 }

Modified: lucene/dev/branches/lucene6835/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java (original)
+++ lucene/dev/branches/lucene6835/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java Tue Dec 22 11:31:17 2015
@@ -213,7 +213,6 @@ public abstract class BaseGeoPointTestCa
     double[] lats = new double[2*numPoints];
     double[] lons = new double[2*numPoints];
     Directory dir = newDirectory();
-    noVirusChecker(dir);
     IndexWriterConfig iwc = newIndexWriterConfig();
     initIndexWriterConfig(FIELD_NAME, iwc);
 
@@ -575,7 +574,6 @@ public abstract class BaseGeoPointTestCa
     } else {
       dir = newDirectory();
     }
-    noVirusChecker(dir);
 
     Set<Integer> deleted = new HashSet<>();
     // RandomIndexWriter is too slow here:
@@ -769,12 +767,5 @@ public abstract class BaseGeoPointTestCa
     }
     IOUtils.close(r, dir);
   }
-
-  protected Directory noVirusChecker(Directory dir) {
-    if (dir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
-    }
-    return dir;
-  }
 }
 

Modified: lucene/dev/branches/lucene6835/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java (original)
+++ lucene/dev/branches/lucene6835/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java Tue Dec 22 11:31:17 2015
@@ -651,7 +651,7 @@ public class TestGeo3DPointField extends
     iwc.setCodec(getCodec());
     Directory dir;
     if (lats.length > 100000) {
-      dir = noVirusChecker(newFSDirectory(createTempDir("TestBKDTree")));
+      dir = newFSDirectory(createTempDir("TestBKDTree"));
     } else {
       dir = getDirectory();
     }
@@ -789,14 +789,7 @@ public class TestGeo3DPointField extends
     IOUtils.close(r, dir);
   }
 
-  private static Directory noVirusChecker(Directory dir) {
-    if (dir instanceof MockDirectoryWrapper) {
-      ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
-    }
-    return dir;
-  }
-
   private static Directory getDirectory() {     
-    return noVirusChecker(newDirectory());
+    return newDirectory();
   }
 }

Modified: lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java (original)
+++ lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java Tue Dec 22 11:31:17 2015
@@ -487,7 +487,7 @@ public class AnalyzingSuggester extends
       tempSortedFileName = sorter.sort(tempInput.getName());
 
       // Free disk space:
-      tempDir.deleteFile(tempInput.getName());
+      tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
 
       reader = new OfflineSorter.ByteSequencesReader(tempDir.openInput(tempSortedFileName, IOContext.READONCE));
      

Modified: lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java (original)
+++ lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java Tue Dec 22 11:31:17 2015
@@ -19,6 +19,7 @@ package org.apache.lucene.search.suggest
 
 import java.io.Closeable;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.Comparator;
 
 import org.apache.lucene.store.IOContext;
@@ -68,7 +69,7 @@ public class ExternalRefSorter implement
         success = true;
       } finally {
         if (success) {
-          sorter.getDirectory().deleteFile(input.getName());
+          sorter.getDirectory().deleteFiles(Collections.singleton(input.getName()));
         } else {
           IOUtils.deleteFilesIgnoringExceptions(sorter.getDirectory(), input.getName());
         }

Modified: lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java?rev=1721365&r1=1721364&r2=1721365&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java (original)
+++ lucene/dev/branches/lucene6835/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java Tue Dec 22 11:31:17 2015
@@ -204,7 +204,7 @@ public class FSTCompletionLookup extends
       // We don't know the distribution of scores and we need to bucket them, so we'll sort
       // and divide into equal buckets.
       tempSortedFileName = sorter.sort(tempInput.getName());
-      tempDir.deleteFile(tempInput.getName());
+      tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
 
       FSTCompletionBuilder builder = new FSTCompletionBuilder(
           buckets, externalSorter, sharedTailLength);




Mime
View raw message