LOL extrafs, I'll fix. Thanks Steve. Mike McCandless
http://blog.mikemccandless.com On Thu, Jan 28, 2016 at 11:50 AM, Steve Rowe <[email protected]> wrote: > Hi Mike, > > My Jenkins's nightly monster trunk job failed on both these tests last night, > and the seeds no longer reproduce after your fix. > > However, a third test failed in the same run, and it still reproduces for me > - not sure if it’s related though: > > —— > [junit4] Suite: org.apache.lucene.index.TestSwappedIndexFiles > [junit4] 2> NOTE: reproduce with: ant test > -Dtestcase=TestSwappedIndexFiles -Dtests.method=test > -Dtests.seed=44AABCD1741D13BA -Dtests.nightly=true -Dtests.slow=true > -Dtests.locale=nl -Dtests.timezone=Asia/Rangoon -Dtests.asserts=true > -Dtests.file.encoding=UTF-8 > [junit4] ERROR 0.30s J0 | TestSwappedIndexFiles.test <<< > [junit4] > Throwable #1: java.io.FileNotFoundException: extra0 in > dir=RAMDirectory@2b74a31d > lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@7454f1e9 > [junit4] > at > __randomizedtesting.SeedInfo.seed([44AABCD1741D13BA:CCFE830BDAE17E42]:0) > [junit4] > at > org.apache.lucene.store.MockDirectoryWrapper.openInput(MockDirectoryWrapper.java:677) > [junit4] > at > org.apache.lucene.store.Directory.copyFrom(Directory.java:154) > [junit4] > at > org.apache.lucene.store.MockDirectoryWrapper.copyFrom(MockDirectoryWrapper.java:1050) > [junit4] > at > org.apache.lucene.index.TestSwappedIndexFiles.swapOneFile(TestSwappedIndexFiles.java:105) > [junit4] > at > org.apache.lucene.index.TestSwappedIndexFiles.swapFiles(TestSwappedIndexFiles.java:92) > [junit4] > at > org.apache.lucene.index.TestSwappedIndexFiles.test(TestSwappedIndexFiles.java:64) > [junit4] > at java.lang.Thread.run(Thread.java:745) > [junit4] 2> NOTE: leaving temporary files on disk at: > /var/lib/jenkins/jobs/Lucene-core-nightly-monster-trunk/workspace/lucene/build/core/test/J0/temp/lucene.index.TestSwappedIndexFiles_44AABCD1741D13BA-001 > [junit4] 2> NOTE: test params are: codec=CheapBastard, > sim=ClassicSimilarity, locale=nl, timezone=Asia/Rangoon > [junit4] 2> NOTE: Linux 4.1.0-custom2-amd64 amd64/Oracle Corporation > 1.8.0_45 (64-bit)/cpus=16,threads=1,free=940415488,total=2549088256 > —— > > -- > Steve > www.lucidworks.com > >> On Jan 28, 2016, at 11:32 AM, [email protected] wrote: >> >> Repository: lucene-solr >> Updated Branches: >> refs/heads/master 79e384bac -> 47fb35c20 >> >> >> fix false failures from test bugs >> >> >> Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo >> Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/47fb35c2 >> Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/47fb35c2 >> Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/47fb35c2 >> >> Branch: refs/heads/master >> Commit: 47fb35c20ac22c0226daa583e0179f8805e54664 >> Parents: 79e384b >> Author: Mike McCandless <[email protected]> >> Authored: Thu Jan 28 11:29:37 2016 -0500 >> Committer: Mike McCandless <[email protected]> >> Committed: Thu Jan 28 11:30:18 2016 -0500 >> >> ---------------------------------------------------------------------- >> .../index/TestAllFilesCheckIndexHeader.java | 23 +++++++++++++++----- >> .../index/TestAllFilesDetectTruncation.java | 4 +++- >> 2 files changed, 21 insertions(+), 6 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/47fb35c2/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java >> ---------------------------------------------------------------------- >> diff --git >> a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java >> >> b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java >> index 9dffaa8..3d8aeff 100644 >> --- >> a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java >> +++ >> b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java >> @@ -19,6 +19,7 @@ package org.apache.lucene.index; >> >> import java.io.EOFException; >> import java.io.IOException; >> +import java.util.Arrays; >> import java.util.Collections; >> >> import org.apache.lucene.analysis.MockAnalyzer; >> @@ -80,7 +81,9 @@ public class TestAllFilesCheckIndexHeader extends >> LuceneTestCase { >> >> private void checkIndexHeader(Directory dir) throws IOException { >> for(String name : dir.listAll()) { >> - checkOneFile(dir, name); >> + if (name.equals(IndexWriter.WRITE_LOCK_NAME) == false) { >> + checkOneFile(dir, name); >> + } >> } >> } >> >> @@ -99,15 +102,25 @@ public class TestAllFilesCheckIndexHeader extends >> LuceneTestCase { >> if (name.equals(victim) == false) { >> dirCopy.copyFrom(dir, name, name, IOContext.DEFAULT); >> } else { >> - try(IndexOutput out = dirCopy.createOutput(name, >> IOContext.DEFAULT); >> - IndexInput in = dir.openInput(name, IOContext.DEFAULT)) { >> + >> + // Iterate until our randomly generated bytes are indeed >> different from the first bytes of the file ... the vast majority of the >> + // time this will only require one iteration! >> + while (true) { >> + try(IndexOutput out = dirCopy.createOutput(name, >> IOContext.DEFAULT); >> + IndexInput in = dir.openInput(name, IOContext.DEFAULT)) { >> // keeps same file length, but replaces the first wrongBytes >> with random bytes: >> byte[] bytes = new byte[wrongBytes]; >> random().nextBytes(bytes); >> out.writeBytes(bytes, 0, bytes.length); >> - in.seek(wrongBytes); >> - out.copyBytes(in, victimLength - wrongBytes); >> + byte[] bytes2 = new byte[wrongBytes]; >> + in.readBytes(bytes2, 0, bytes2.length); >> + if (Arrays.equals(bytes, bytes2) == false) { >> + // We successfully randomly generated bytes that differ >> from the bytes in the file: >> + out.copyBytes(in, victimLength - wrongBytes); >> + break; >> + } >> } >> + } >> } >> dirCopy.sync(Collections.singleton(name)); >> } >> >> http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/47fb35c2/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java >> ---------------------------------------------------------------------- >> diff --git >> a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java >> >> b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java >> index bda5857..e5aa6c7 100644 >> --- >> a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java >> +++ >> b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java >> @@ -80,7 +80,9 @@ public class TestAllFilesDetectTruncation extends >> LuceneTestCase { >> >> private void checkTruncation(Directory dir) throws IOException { >> for(String name : dir.listAll()) { >> - truncateOneFile(dir, name); >> + if (name.equals(IndexWriter.WRITE_LOCK_NAME) == false) { >> + truncateOneFile(dir, name); >> + } >> } >> } >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
