Skip to content

Commit a173001

Browse files
authored
Adjust number of replicas in YAML REST tests (#93386)
Some core yaml rest tests use an explicit number of replicas when creating indices. I suspect that this is often not needed and it prevents those tests to run in a 2 nodes (index & search) cluster. Most of the impacted tests are search related so I'll use the :Search/Search label. Relates ES-5253
1 parent ea17a19 commit a173001

27 files changed

+72
-108
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health/10_basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
- skip:
212212
version: " - 7.1.99"
213213
reason: "closed indices are replicated starting version 7.2.0"
214-
features: ["allowed_warnings"]
214+
features: ["allowed_warnings", "default_shards"]
215215

216216
- do:
217217
indices.create:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.blocks/10_basic.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
- do:
77
indices.create:
88
index: test_index
9-
body:
10-
settings:
11-
number_of_replicas: 0
129

1310
- do:
1411
indices.add_block:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.open/10_basic.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
- do:
77
indices.create:
88
index: test_index
9-
body:
10-
settings:
11-
number_of_replicas: 0
129

1310
- do:
1411
cluster.health:
15-
wait_for_status: green
12+
index: [test_index]
13+
wait_for_no_initializing_shards: true
1614

1715
- do:
1816
indices.close:
@@ -34,7 +32,8 @@
3432

3533
- do:
3634
cluster.health:
37-
wait_for_status: green
35+
index: [test_index]
36+
wait_for_no_initializing_shards: true
3837

3938
- do:
4039
search:
@@ -88,6 +87,7 @@
8887
- is_true: acknowledged
8988
- match: { acknowledged: true }
9089
- match: { shards_acknowledged: true }
90+
9191
---
9292
"Close index response with result per index":
9393
- skip:
@@ -96,23 +96,19 @@
9696
- do:
9797
indices.create:
9898
index: index_1
99-
body:
100-
settings:
101-
number_of_replicas: 0
10299

103100
- do:
104101
indices.create:
105102
index: index_2
106-
body:
107-
settings:
108-
number_of_replicas: 0
109103

110104
- do:
111105
indices.create:
112106
index: index_3
113-
body:
114-
settings:
115-
number_of_replicas: 0
107+
108+
- do:
109+
cluster.health:
110+
index: [index_1, index_2, index_3]
111+
wait_for_no_initializing_shards: true
116112

117113
- do:
118114
indices.close:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,19 @@ setup:
22
- do:
33
indices.create:
44
index: test_index1
5-
body:
6-
settings:
7-
number_of_replicas: 0
5+
86
- do:
97
indices.create:
108
index: test_index2
11-
body:
12-
settings:
13-
number_of_replicas: 0
9+
1410
- do:
1511
indices.create:
1612
index: test_index3
17-
body:
18-
settings:
19-
number_of_replicas: 0
13+
2014
- do:
2115
cluster.health:
22-
wait_for_status: green
16+
index: [test_index1, test_index2, test_index3]
17+
wait_for_no_initializing_shards: true
2318

2419
---
2520
"All indices":
@@ -46,7 +41,8 @@ setup:
4641

4742
- do:
4843
cluster.health:
49-
wait_for_status: green
44+
index: [test_index1, test_index2, test_index3]
45+
wait_for_no_initializing_shards: true
5046

5147
- do:
5248
search:
@@ -78,7 +74,8 @@ setup:
7874

7975
- do:
8076
cluster.health:
81-
wait_for_status: green
77+
index: [test_index1, test_index2, test_index3]
78+
wait_for_no_initializing_shards: true
8279

8380
- do:
8481
search:
@@ -110,7 +107,8 @@ setup:
110107

111108
- do:
112109
cluster.health:
113-
wait_for_status: green
110+
index: [test_index1, test_index2, test_index3]
111+
wait_for_no_initializing_shards: true
114112

115113
- do:
116114
search:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.sort/10_basic.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
body:
88
settings:
99
number_of_shards: 1
10-
number_of_replicas: 0
1110
index.sort.field: rank
1211
mappings:
1312
properties:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/mlt/10_basic.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
indices.create:
55
index: test_1
66
body:
7-
settings:
8-
index:
9-
number_of_replicas: 0
107
mappings:
118
properties:
129
foo:
@@ -23,10 +20,6 @@
2320
- do:
2421
indices.refresh: {}
2522

26-
- do:
27-
cluster.health:
28-
wait_for_status: green
29-
3023
- do:
3124
search:
3225
rest_total_hits_as_int: true

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/mlt/20_docs.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
- do:
44
indices.create:
55
index: test_1
6-
body:
7-
settings:
8-
number_of_replicas: 0
6+
97
- do:
108
index:
119
index: test_1
@@ -27,10 +25,6 @@
2725
- do:
2826
indices.refresh: {}
2927

30-
- do:
31-
cluster.health:
32-
wait_for_status: green
33-
3428
- do:
3529
search:
3630
rest_total_hits_as_int: true

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/mlt/30_unlike.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
- do:
44
indices.create:
55
index: test_1
6-
body:
7-
settings:
8-
number_of_replicas: 0
6+
97
- do:
108
index:
119
index: test_1
@@ -27,10 +25,6 @@
2725
- do:
2826
indices.refresh: {}
2927

30-
- do:
31-
cluster.health:
32-
wait_for_status: green
33-
3428
- do:
3529
search:
3630
rest_total_hits_as_int: true

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/msearch/20_typed_keys.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ setup:
44
indices.create:
55
index: test-0
66
body:
7-
settings:
8-
number_of_replicas: 0
97
mappings:
108
properties:
119
index_start_at:
@@ -23,8 +21,6 @@ setup:
2321
indices.create:
2422
index: test-1
2523
body:
26-
settings:
27-
number_of_replicas: 0
2824
mappings:
2925
properties:
3026
index_start_at:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/range/10_basic.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ setup:
33
indices.create:
44
index: test
55
body:
6-
settings:
7-
number_of_replicas: 0
86
mappings:
97
"properties":
108
"integer_range":

0 commit comments

Comments
 (0)