Skip to content

Commit 92bf1d0

Browse files
committed
Change status and wait for active shards
1 parent 7641f2b commit 92bf1d0

File tree

9 files changed

+28
-19
lines changed

9 files changed

+28
-19
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ setup:
1111
synonyms_set:
1212
synonyms: "foo => bar, baz"
1313

14-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
14+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1515
- do:
1616
cluster.health:
1717
index: .synonyms-2
1818
level: shards
19+
wait_for_active_shards: 2
1920
timeout: 1m
20-
wait_for_status: green
21+
wait_for_status: yellow
2122

2223
- do:
2324
indices.create:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/20_synonyms_get.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ setup:
1414
- synonyms: "test => check"
1515
id: "test-id-3"
1616

17-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1818
- do:
1919
cluster.health:
2020
index: .synonyms-2
2121
level: shards
22+
wait_for_active_shards: 2
2223
timeout: 1m
23-
wait_for_status: green
24+
wait_for_status: yellow
2425

2526
---
2627
"Get synonyms set":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/30_synonyms_delete.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ setup:
1212
- synonyms: "bye => goodbye"
1313
id: "test-id-2"
1414

15-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
15+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1616
- do:
1717
cluster.health:
1818
index: .synonyms-2
1919
level: shards
20+
wait_for_active_shards: 2
2021
timeout: 1m
21-
wait_for_status: green
22+
wait_for_status: yellow
2223

2324
---
2425
"Delete synonyms set":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ setup:
3030
persistent:
3131
logger.org.elasticsearch.synonyms: DEBUG
3232

33-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
33+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
3434
- do:
3535
cluster.health:
3636
index: .synonyms-2
3737
level: shards
38+
wait_for_active_shards: 2
3839
timeout: 1m
39-
wait_for_status: green
40+
wait_for_status: yellow
4041

4142

4243
---

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ setup:
1414
- synonyms: "test => check"
1515
id: "test-id-3"
1616

17-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1818
- do:
1919
cluster.health:
2020
index: .synonyms-2
2121
level: shards
22+
wait_for_active_shards: 2
2223
timeout: 1m
23-
wait_for_status: green
24+
wait_for_status: yellow
2425

2526
---
2627
"Update a synonyms rule":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/60_synonym_rule_get.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ setup:
1414
- synonyms: "test => check"
1515
id: "test-id-3"
1616

17-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1818
- do:
1919
cluster.health:
2020
index: .synonyms-2
2121
level: shards
22-
timeout: 1m
23-
wait_for_status: green
22+
wait_for_active_shards: 2
23+
timeout: 20s
24+
wait_for_status: yellow
2425

2526
---
2627
"Get a synonym rule":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ setup:
1414
- synonyms: "test => check"
1515
id: "test-id-3"
1616

17-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1818
- do:
1919
cluster.health:
2020
index: .synonyms-2
2121
level: shards
22+
wait_for_active_shards: 2
2223
timeout: 1m
23-
wait_for_status: green
24+
wait_for_status: yellow
2425

2526

2627
---

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/80_synonyms_from_index.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ setup:
1414
- synonyms: "bye => goodbye"
1515
id: "synonym-rule-2"
1616

17-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
1818
- do:
1919
cluster.health:
2020
index: .synonyms-2
2121
level: shards
22+
wait_for_active_shards: 2
2223
timeout: 1m
23-
wait_for_status: green
24+
wait_for_status: yellow
2425

2526
# Create an index with synonym_filter that uses that synonyms set
2627
- do:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
- synonyms: "bye => goodbye"
2727
id: "synonym-rule-2"
2828

29-
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
29+
# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
3030
- do:
3131
cluster.health:
3232
index: .synonyms-2
3333
level: shards
34+
wait_for_active_shards: 2
3435
timeout: 1m
35-
wait_for_status: green
36+
wait_for_status: yellow
3637

3738
# Create my_index1 with synonym_filter that uses synonyms_set1
3839
- do:

0 commit comments

Comments
 (0)