[TEST] wait for flush to ensure at least one segment is visible / existing

This commit is contained in:
Simon Willnauer 2015-10-23 09:17:07 +02:00
parent d8dcf7b81e
commit 075e382c6d
1 changed files with 3 additions and 3 deletions

View File

@ -45,19 +45,19 @@ public class IndicesSegmentsRequestTests extends ESSingleNodeTestCase {
String id = Integer.toString(j);
client().prepareIndex("test", "type1", id).setSource("text", "sometext").get();
}
client().admin().indices().prepareFlush("test").get();
client().admin().indices().prepareFlush("test").setWaitIfOngoing(true).get();
}
public void testBasic() {
IndicesSegmentResponse rsp = client().admin().indices().prepareSegments("test").get();
List<Segment> segments = rsp.getIndices().get("test").iterator().next().getShards()[0].getSegments();
assertNull(segments.get(0).ramTree);
assertNull(segments.get(0).toString(), segments.get(0).ramTree);
}
public void testVerbose() {
IndicesSegmentResponse rsp = client().admin().indices().prepareSegments("test").setVerbose(true).get();
List<Segment> segments = rsp.getIndices().get("test").iterator().next().getShards()[0].getSegments();
assertNotNull(segments.get(0).ramTree);
assertNotNull(segments.get(0).toString(), segments.get(0).ramTree);
}
/**