index another doc in test and flush to force merge

This commit is contained in:
Shay Banon 2013-10-14 14:50:44 +02:00
parent 08db1fb292
commit b99fca342f
1 changed files with 5 additions and 1 deletions

View File

@ -362,8 +362,12 @@ public class RobinEngineTests extends ElasticsearchTestCase {
waitForMerge.get().countDown();
index = new Engine.Index(null, newUid("4"), doc);
engine.index(index);
engine.flush(new Engine.Flush());
// now, optimize and wait for merges, see that we have no merge flag
engine.optimize(new Engine.Optimize().maxNumSegments(1).waitForMerge(true));
engine.optimize(new Engine.Optimize().flush(true).maxNumSegments(1).waitForMerge(true));
for (Segment segment : engine.segments()) {
assertThat(segment.getMergeId(), nullValue());