Apache Lucene open-source search software
LUCENE-7345: MDW now disables VirusCheckingFS while trying to corrupt files
Mike McCandlessb338a0c0f006
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.javaindex 193d877b076..4f7de29b70f 100644--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java@@ -292,6 +292,17 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {}public synchronized void corruptFiles(Collection<String> files) throws IOException {+ boolean disabled = TestUtil.disableVirusChecker(in);+ try {+ _corruptFiles(files);+ } finally {+ if (disabled) {+ TestUtil.enableVirusChecker(in);+ }+ }+ }++ private synchronized void _corruptFiles(Collection<String> files) throws IOException {// Must make a copy because we change the incoming unsyncedFiles// when we create temp files, delete, etc., below:final List<String> filesToCorrupt = new ArrayList<>(files);