mirror of https://github.com/apache/lucene.git
LUCENE-952: force synchronized access to writer instance variable to fix infinite spin loop in TestGdataIndexer
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@554189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d7c0af3f30
commit
96ea45d193
|
@ -400,6 +400,11 @@ public class GDataIndexer {
|
|||
|
||||
}
|
||||
|
||||
// Used only for testing
|
||||
protected synchronized IndexWriter getWriter() {
|
||||
return this.writer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This factory method creates a new GDataIndexer using a instance of
|
||||
* {@link IndexTask}
|
||||
|
|
|
@ -552,7 +552,7 @@ public void testAddDocument() throws IOException {
|
|||
latch.countDown();
|
||||
documentLatch.await(5000,TimeUnit.MILLISECONDS);
|
||||
// wait active for the commit
|
||||
while(this.indexer.writer != null){}
|
||||
while(this.indexer.getWriter() != null){}
|
||||
|
||||
IndexSearcher s = new IndexSearcher(this.dir);
|
||||
Hits h = s.search(new TermQuery(delTerm));
|
||||
|
|
Loading…
Reference in New Issue