apache / apache/lucene

TestIndexWriterWithThreads.testOpenTwoIndexWritersOnDifferentThreads test failure [LUCENE-3547]

Open
#4,621 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

seen it fail like 5 times while running some tests the last few days (trunk)

```Java
[junit] Testsuite: org.apache.lucene.index.TestIndexWriterWithThreads
[junit] Testcase: testOpenTwoIndexWritersOnDifferentThreads(org.apache.lucene.index.TestIndexWriterWithThreads): FAILED
[junit] Failed due to: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.MockLockFactoryWrapper$MockLock@705da7e0
[junit] junit.framework.AssertionFailedError: Failed due to: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.MockLockFactoryWrapper$MockLock@705da7e0
[junit] at org.apache.lucene.index.TestIndexWriterWithThreads.testOpenTwoIndexWritersOnDifferentThreads(TestIndexWriterWithThreads.java:447)
[junit] at org.apache.lucene.util.LuceneTestCase$2$1.evaluate(LuceneTestCase.java:615)
[junit] at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:149)
[junit] at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:51)
[junit]
[junit]
[junit] Tests run: 11, Failures: 1, Errors: 0, Time elapsed: 19.31 sec
[junit]
[junit] ------------- Standard Output ---------------
[junit] org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.MockLockFactoryWrapper$MockLock@705da7e0
[junit] at org.apache.lucene.store.Lock.obtain(Lock.java:84)
[junit] at org.apache.lucene.index.IndexWriter.(IndexWriter.java:848)
[junit] at org.apache.lucene.index.TestIndexWriterWithThreads$DelayedIndexAndCloseRunnable.run(TestIndexWriterWithThreads.java:480)
[junit] ------------- ---------------- ---------------
[junit] ------------- Standard Error -----------------
[junit] NOTE: reproduce with: ant test -Dtestcase=TestIndexWriterWithThreads -Dtestmethod=testOpenTwoIndexWritersOnDifferentThreads -Dtests.seed=-75d13bd0fcdda0dd:-554b0eba6bdcc8d:-3f8911a7fc9514ef
[junit] NOTE: test params are: codec=RandomCodecProvider: {field=SimpleText}, sim=RandomSimilarityProvider(queryNorm=false,coord=true): {field=DFR I(F)L2}, locale=ru, timezone=Asia/Pontianak
[junit] NOTE: all tests run in this JVM:
[junit] [TestDateTools, TestByteSlices, TestCompoundFile, TestConsistentFieldNumbers, TestForTooMuchCloning, TestGlobalFieldNumbers, TestIndexCommit, TestIndexWriterWithThreads]
[junit] NOTE: Linux 3.0.6-gentoo amd64/Sun Microsystems Inc. 1.6.0_27 (64-bit)/cpus=8,threads=1,free=112228008,total=240975872
[junit] ------------- ---------------- ---------------
```

---
Migrated from [LUCENE-3547](https://issues.apache.org/jira/browse/LUCENE-3547) by selckin

Contributor guide

Open the contributing guide

Research direction

Start with TestIndexWriterWithThreads.java, especially testOpenTwoIndexWritersOnDifferentThreads around line 447 and DelayedIndexAndCloseRunnable around line 480. Run the provided Ant command with the recorded seed, then investigate the lock-timeout failure; done means the test no longer fails intermittently when opening writers on different threads.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.