Skip to content

Commit 4010ff1

Browse files
Fix SimpleNestedExplainIT.testExplainMultipleDocs flakiness (opensearch-project#12776)
Signed-off-by: Neetika Singhal <neetiks@amazon.com>
1 parent 122e944 commit 4010ff1

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedExplainIT.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
*/
3131
public class SimpleNestedExplainIT extends OpenSearchIntegTestCase {
3232

33+
@Override
34+
protected int numberOfShards() {
35+
return 1;
36+
}
37+
3338
/*
3439
* Tests the explain output for multiple docs. Concurrent search with multiple slices is tested
3540
* here as call to indexRandomForMultipleSlices is made and compared with explain output for
@@ -70,7 +75,23 @@ public void testExplainMultipleDocs() throws Exception {
7075
.setRefreshPolicy(IMMEDIATE)
7176
.get();
7277

73-
indexRandomForMultipleSlices("test");
78+
client().prepareIndex("test")
79+
.setId("2")
80+
.setSource(
81+
jsonBuilder().startObject()
82+
.field("field1", "value2")
83+
.startArray("nested1")
84+
.startObject()
85+
.field("n_field1", "n_value2")
86+
.endObject()
87+
.startObject()
88+
.field("n_field1", "n_value2")
89+
.endObject()
90+
.endArray()
91+
.endObject()
92+
)
93+
.setRefreshPolicy(IMMEDIATE)
94+
.get();
7495

7596
// Turn off the concurrent search setting to test search with non-concurrent search
7697
client().admin()

0 commit comments

Comments
 (0)