Skip to content

Commit

Permalink
Fixed SegmentTest test case time dependant occasional failures
Browse files Browse the repository at this point in the history
As highlighted by latest automated Travis builds.
  • Loading branch information
luccioman committed Jan 2, 2018
1 parent 8a4ea1c commit 36e9b1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/net/yacy/kelondro/rwi/IndexCell.java
Expand Up @@ -153,6 +153,7 @@ private void flushBuffer() {
// get a fresh ram cache
IndexCell.this.ram = new ReferenceContainerCache<ReferenceType>(IndexCell.this.factory, termOrder, termSize);
}
// WARNING : if this cell is queried before this dump termination, terms are no longer in the cache and would therefore not be found
// dump the buffer
IndexCell.this.merger.dump(ramdump, dumpFile, IndexCell.this.array);
IndexCell.this.lastDump = System.currentTimeMillis();
Expand Down
6 changes: 5 additions & 1 deletion test/java/net/yacy/search/index/SegmentTest.java
Expand Up @@ -48,9 +48,13 @@ public void setUp() throws IOException {
new File("test/DATA/INDEX/webportal/SEGMENTS"),
new File("test/DATA/INDEX/webportal/ARCHIVE"),
null, null);

/* Warning : ensure the size is larger than the maximum number of test terms added to the index, otherwise
* query tests might randomly fail depending on when the index dump job (IndexCell.FlushThread) is run */
final int entityCacheMaxSize = 20;

// connect RWI index
index.connectRWI(10, 1024);
index.connectRWI(entityCacheMaxSize, 1024);
}

@After
Expand Down

0 comments on commit 36e9b1c

Please sign in to comment.