Skip to content

Commit ba7d095

Browse files
authored
Fix synonyms CI tests timeout (#114641)
1 parent 43b93dc commit ba7d095

11 files changed

+50
-29
lines changed

muted-tests.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,6 @@ tests:
259259
- class: org.elasticsearch.xpack.inference.DefaultElserIT
260260
method: testInferCreatesDefaultElser
261261
issue: https://github.com/elastic/elasticsearch/issues/114503
262-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
263-
method: test {p0=synonyms/60_synonym_rule_get/Synonym set not found}
264-
issue: https://github.com/elastic/elasticsearch/issues/114432
265-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
266-
method: test {p0=synonyms/60_synonym_rule_get/Get a synonym rule}
267-
issue: https://github.com/elastic/elasticsearch/issues/114443
268-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
269-
method: test {p0=synonyms/60_synonym_rule_get/Synonym rule not found}
270-
issue: https://github.com/elastic/elasticsearch/issues/114444
271262
- class: org.elasticsearch.xpack.inference.integration.ModelRegistryIT
272263
method: testGetModel
273264
issue: https://github.com/elastic/elasticsearch/issues/114657

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

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

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

18+
- do:
19+
cluster.health:
20+
wait_for_no_initializing_shards: true
21+
1822
- do:
1923
synonyms.get_synonym:
2024
id: test-update-synonyms
@@ -58,6 +62,10 @@ setup:
5862

5963
- match: { result: "created" }
6064

65+
- do:
66+
cluster.health:
67+
wait_for_no_initializing_shards: true
68+
6169
- do:
6270
synonyms.get_synonym:
6371
id: test-empty-synonyms

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ 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+
wait_for_no_initializing_shards: true
18+
1419
- do:
1520
indices.create:
1621
index: test_index

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ 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+
wait_for_no_initializing_shards: true
1721

1822
---
1923
"Get synonyms set":
@@ -31,7 +35,6 @@ setup:
3135
id: "test-id-2"
3236
- synonyms: "test => check"
3337
id: "test-id-3"
34-
3538
---
3639
"Get synonyms set - not found":
3740
- do:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ 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+
wait_for_no_initializing_shards: true
1519
---
1620
"Delete synonyms set":
1721
- do:

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ 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+
wait_for_no_initializing_shards: true
17+
1218
- do:
1319
synonyms.put_synonym:
1420
id: test-synonyms-1
@@ -23,21 +29,8 @@ setup:
2329
body:
2430
synonyms_set:
2531
- synonyms: "pc, computer"
26-
# set logging to debug for issue: https://github.com/elastic/elasticsearch/issues/102261
27-
- do:
28-
cluster.put_settings:
29-
body:
30-
persistent:
31-
logger.org.elasticsearch.synonyms: DEBUG
3232

3333
---
34-
teardown:
35-
- do:
36-
cluster.put_settings:
37-
body:
38-
persistent:
39-
logger.org.elasticsearch.synonyms: null
40-
---
4134
"List synonyms set":
4235
- do:
4336
synonyms.get_synonyms_sets: { }

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

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

17-
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+
wait_for_no_initializing_shards: true
1821
---
1922
"Update a synonyms rule":
2023
- do:

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
@@ -13,11 +13,12 @@ setup:
1313
id: "test-id-2"
1414
- synonyms: "test => check"
1515
id: "test-id-3"
16+
17+
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
1618
- do:
1719
cluster.health:
18-
index: .synonyms
19-
timeout: 1m
20-
wait_for_status: green
20+
wait_for_no_initializing_shards: true
21+
2122

2223
---
2324
"Get a synonym rule":

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ 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+
wait_for_no_initializing_shards: true
21+
1722
---
1823
"Delete synonym rule":
1924
- do:

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ setup:
22
- requires:
33
cluster_features: ["gte_v8.10.0"]
44
reason: Loading synonyms from index is introduced in 8.10.0
5-
65
# Create a new synonyms set
76
- do:
87
synonyms.put_synonym:
@@ -14,6 +13,11 @@ setup:
1413
- synonyms: "bye => goodbye"
1514
id: "synonym-rule-2"
1615

16+
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
17+
- do:
18+
cluster.health:
19+
wait_for_no_initializing_shards: true
20+
1721
# Create an index with synonym_filter that uses that synonyms set
1822
- do:
1923
indices.create:

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
- requires:
44
cluster_features: ["gte_v8.10.0"]
55
reason: Reloading analyzers for specific synonym set is introduced in 8.10.0
6-
76
# Create synonyms_set1
87
- do:
98
synonyms.put_synonym:
@@ -26,6 +25,11 @@
2625
- synonyms: "bye => goodbye"
2726
id: "synonym-rule-2"
2827

28+
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
29+
- do:
30+
cluster.health:
31+
wait_for_no_initializing_shards: true
32+
2933
# Create my_index1 with synonym_filter that uses synonyms_set1
3034
- do:
3135
indices.create:

0 commit comments

Comments
 (0)