Skip to content

Commit a154b73

Browse files
Assure index ops are successful for SimpleNestedIT (#44815)
relates to #44486
1 parent 3f48720 commit a154b73

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/src/test/java/org/elasticsearch/search/nested/SimpleNestedIT.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
2727
import org.elasticsearch.action.delete.DeleteResponse;
2828
import org.elasticsearch.action.get.GetResponse;
29+
import org.elasticsearch.action.index.IndexResponse;
2930
import org.elasticsearch.action.search.SearchRequestBuilder;
3031
import org.elasticsearch.action.search.SearchResponse;
3132
import org.elasticsearch.action.search.SearchType;
@@ -1208,7 +1209,7 @@ public void testNestedSortingWithNestedFilterAsFilter() throws Exception {
12081209
.endObject()
12091210
.endObject().endObject()));
12101211

1211-
client().prepareIndex("test", "type", "1").setSource(jsonBuilder().startObject()
1212+
IndexResponse indexResponse1 = client().prepareIndex("test", "type", "1").setSource(jsonBuilder().startObject()
12121213
.field("officelocation", "gendale")
12131214
.startArray("users")
12141215
.startObject()
@@ -1255,8 +1256,9 @@ public void testNestedSortingWithNestedFilterAsFilter() throws Exception {
12551256
.endObject()
12561257
.endArray()
12571258
.endObject()).get();
1259+
assertTrue(indexResponse1.getShardInfo().getSuccessful() > 0);
12581260

1259-
client().prepareIndex("test", "type", "2").setSource(jsonBuilder().startObject()
1261+
IndexResponse indexResponse2 = client().prepareIndex("test", "type", "2").setSource(jsonBuilder().startObject()
12601262
.field("officelocation", "gendale")
12611263
.startArray("users")
12621264
.startObject()
@@ -1303,6 +1305,7 @@ public void testNestedSortingWithNestedFilterAsFilter() throws Exception {
13031305
.endObject()
13041306
.endArray()
13051307
.endObject()).get();
1308+
assertTrue(indexResponse2.getShardInfo().getSuccessful() > 0);
13061309
refresh();
13071310

13081311
SearchResponse searchResponse = client().prepareSearch("test")

0 commit comments

Comments
 (0)