Index: lucene/src/test/org/apache/lucene/index/TestTransactions.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestTransactions.java (revision 1026400) +++ lucene/src/test/org/apache/lucene/index/TestTransactions.java (working copy) @@ -168,10 +168,18 @@ @Override public void doWork() throws Throwable { - IndexReader r1, r2; + IndexReader r1 = null, r2 = null; synchronized(lock) { - r1 = IndexReader.open(dir1, true); - r2 = IndexReader.open(dir2, true); + try { + r1 = IndexReader.open(dir1, true); + r2 = IndexReader.open(dir2, true); + } catch (IOException e) { + if (!e.getMessage().contains("on purpose")) + throw e; + if (r1 != null) r1.close(); + if (r2 != null) r2.close(); + return; + } } if (r1.numDocs() != r2.numDocs()) throw new RuntimeException("doc counts differ: r1=" + r1.numDocs() + " r2=" + r2.numDocs()); Index: lucene/src/test/org/apache/lucene/store/MockDirectoryWrapper.java =================================================================== --- lucene/src/test/org/apache/lucene/store/MockDirectoryWrapper.java (revision 1026400) +++ lucene/src/test/org/apache/lucene/store/MockDirectoryWrapper.java (working copy) @@ -246,6 +246,7 @@ @Override public synchronized IndexOutput createOutput(String name) throws IOException { + maybeThrowDeterministicException(); if (crashed) throw new IOException("cannot createOutput after crash"); init(); @@ -284,6 +285,7 @@ @Override public synchronized IndexInput openInput(String name) throws IOException { + maybeThrowDeterministicException(); if (!delegate.fileExists(name)) throw new FileNotFoundException(name); else {