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:50:21 UTC
lucene-solr:branch_6x: LUCENE-7345: MDW now disables VirusCheckingFS
while trying to corrupt files
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 3a9019e02 -> 113afcf02
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/113afcf0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/113afcf0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/113afcf0
Branch: refs/heads/branch_6x
Commit: 113afcf024b7aea8cb992c16be7179d5f77d117a
Parents: 3a9019e
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:09 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/113afcf0/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);