[TEST] wait for flush to ensure at least one segment is visible / existing
This commit is contained in:
parent
d8dcf7b81e
commit
075e382c6d
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue