You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/06/21 08:53:32 UTC
lucene-solr:master: LUCENE-7345: MDW now disables VirusCheckingFS
while trying to corrupt files
Repository: lucene-solr
Updated Branches:
refs/heads/master 7cd151300 -> b338a0c0f
LUCENE-7345: MDW now disables VirusCheckingFS while trying to corrupt files
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b338a0c0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b338a0c0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b338a0c0
Branch: refs/heads/master
Commit: b338a0c0f0062794306f11d53941aad04c4622ae
Parents: 7cd1513
Author: Mike McCandless <mi...@apache.org>
Authored: Tue Jun 21 04:50:09 2016 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Tue Jun 21 04:50:34 2016 -0400
----------------------------------------------------------------------
.../org/apache/lucene/store/MockDirectoryWrapper.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b338a0c0/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
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 193d877..4f7de29 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);