Skip to content

Commit a9f4bf8

Browse files
authored
Fix and unmute synonyms tests using timeout (#117486) (#117517)
1 parent 952df62 commit a9f4bf8

File tree

10 files changed

+84
-0
lines changed

10 files changed

+84
-0
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ setup:
1515

1616
- match: { result: "created" }
1717

18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
24+
1825
- do:
1926
synonyms.get_synonym:
2027
id: test-update-synonyms
@@ -58,6 +65,13 @@ setup:
5865

5966
- match: { result: "created" }
6067

68+
- do:
69+
cluster.health:
70+
index: .synonyms-2
71+
timeout: 2s
72+
wait_for_status: green
73+
ignore: 408
74+
6175
- do:
6276
synonyms.get_synonym:
6377
id: test-empty-synonyms

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +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.
15+
- do:
16+
cluster.health:
17+
index: .synonyms-2
18+
timeout: 2s
19+
wait_for_status: green
20+
ignore: 408
21+
1422
- do:
1523
indices.create:
1624
index: test_index

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ 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.
18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
1724

1825
---
1926
"Get synonyms set":

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +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.
16+
- do:
17+
cluster.health:
18+
index: .synonyms-2
19+
timeout: 2s
20+
wait_for_status: green
21+
ignore: 408
22+
1523
---
1624
"Delete synonyms set":
1725
- do:

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ setup:
99
synonyms_set:
1010
- synonyms: "hello, hi"
1111
- synonyms: "goodbye, bye"
12+
13+
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
14+
- do:
15+
cluster.health:
16+
index: .synonyms-2
17+
timeout: 2s
18+
wait_for_status: green
19+
ignore: 408
20+
1221
- do:
1322
synonyms.put_synonym:
1423
id: test-synonyms-1

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ 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.
18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
1724

1825
---
1926
"Update a synonyms rule":

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ 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.
18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
1724

1825
---
1926
"Get a synonym rule":

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +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.
18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
24+
1725
---
1826
"Delete synonym rule":
1927
- do:

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +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.
18+
- do:
19+
cluster.health:
20+
index: .synonyms-2
21+
timeout: 2s
22+
wait_for_status: green
23+
ignore: 408
24+
1725
# Create an index with synonym_filter that uses that synonyms set
1826
- do:
1927
indices.create:

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +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.
30+
- do:
31+
cluster.health:
32+
index: .synonyms-2
33+
timeout: 2s
34+
wait_for_status: green
35+
ignore: 408
36+
2937
# Create my_index1 with synonym_filter that uses synonyms_set1
3038
- do:
3139
indices.create:

0 commit comments

Comments
 (0)