mirror of
https://github.com/apache/lucene.git
synced 2025-02-28 21:39:25 +00:00
LUCENE-7345: MDW now disables VirusCheckingFS while trying to corrupt files
This commit is contained in:
parent
7cd1513006
commit
b338a0c0f0
@ -292,6 +292,17 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void corruptFiles(Collection<String> files) throws IOException {
|
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
|
// Must make a copy because we change the incoming unsyncedFiles
|
||||||
// when we create temp files, delete, etc., below:
|
// when we create temp files, delete, etc., below:
|
||||||
final List<String> filesToCorrupt = new ArrayList<>(files);
|
final List<String> filesToCorrupt = new ArrayList<>(files);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user