[TEST] Force flush to ensure multiple segments.

Relates to #35333
This commit is contained in:
Martijn van Groningen 2018-11-13 14:24:42 +01:00
parent 3229dfc4de
commit 0487181d0f
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@
package org.elasticsearch.xpack.ccr.action;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.action.admin.indices.stats.ShardStats;
@ -99,6 +100,7 @@ public class ShardChangesTests extends ESSingleNodeTestCase {
for (int i = 0; i < 32; i++) {
client().prepareIndex("index", "_doc", "1").setSource("{}", XContentType.JSON).get();
client().prepareDelete("index", "_doc", "1").get();
client().admin().indices().flush(new FlushRequest("index").force(true)).actionGet();
}
client().admin().indices().refresh(new RefreshRequest("index")).actionGet();
ForceMergeRequest forceMergeRequest = new ForceMergeRequest("index");