From 113afcf024b7aea8cb992c16be7179d5f77d117a Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Tue, 21 Jun 2016 04:50:09 -0400 Subject: [PATCH] LUCENE-7345: MDW now disables VirusCheckingFS while trying to corrupt files --- .../org/apache/lucene/store/MockDirectoryWrapper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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.java index 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 files) throws IOException { + boolean disabled = TestUtil.disableVirusChecker(in); + try { + _corruptFiles(files); + } finally { + if (disabled) { + TestUtil.enableVirusChecker(in); + } + } + } + + private synchronized void _corruptFiles(Collection files) throws IOException { // Must make a copy because we change the incoming unsyncedFiles // when we create temp files, delete, etc., below: final List filesToCorrupt = new ArrayList<>(files);