Re: 2 exceptions in IndexWriter

2013-07-25 Thread Michael McCandless
Are you sure each test always closes the IndexWriter? Still, it's best to have each test uses its own directory to avoid any risk of confusing failures ... Mike McCandless http://blog.mikemccandless.com On Thu, Jul 25, 2013 at 12:24 PM, Yonghui Zhao wrote: > My test case first create an empty

Re: 2 exceptions in IndexWriter

2013-07-25 Thread Yonghui Zhao
My test case first create an empty disk index folder then feed some doc then do some query. I purge the index by delete all files in the folder. My unit test has several test cases they use same directory in the disk. But it runs one by oneļ¼Œand I dont think there will be 2 threads use the directo

Re: 2 exceptions in IndexWriter

2013-07-25 Thread Michael McCandless
Can you describe what your test is doing? How do you "purge the index"? It's best to open IndexWriter with OpenMode.CREATE to purge (rather than remove the files yourself). Lock obtain timed out means another IndexWriter is currently using that directory. Mike McCandless http://blog.mikemcca

2 exceptions in IndexWriter

2013-07-24 Thread Yonghui Zhao
Recently I find my unit test will failed sometimes but no always. I use Lucene 4.3.0 After inverstigation, I found when I try to open a IndexWriter for a disk directory. Some time it will throw this exception: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLoc