Skip to content

Commit 7fdc008

Browse files
authored
Fix BwC synonyms tests (#118691) (#118820)
(cherry picked from commit d09d57d) # Conflicts: # muted-tests.yml # rest-api-spec/build.gradle # rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml
1 parent ee51041 commit 7fdc008

File tree

3 files changed

+118
-91
lines changed

3 files changed

+118
-91
lines changed

muted-tests.yml

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
11
tests:
2-
- class: "org.elasticsearch.upgrades.SearchStatesIT"
3-
issue: "https://github.com/elastic/elasticsearch/issues/108991"
4-
method: "testCanMatch"
5-
- class: "org.elasticsearch.upgrades.MlTrainedModelsUpgradeIT"
6-
issue: "https://github.com/elastic/elasticsearch/issues/108993"
7-
method: "testTrainedModelInference"
8-
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
9-
method: test {yaml=reference/esql/esql-async-query-api/line_17}
10-
issue: https://github.com/elastic/elasticsearch/issues/109260
11-
- class: "org.elasticsearch.client.RestClientSingleHostIntegTests"
12-
issue: "https://github.com/elastic/elasticsearch/issues/102717"
13-
method: "testRequestResetAndAbort"
14-
- class: "org.elasticsearch.xpack.inference.InferenceCrudIT"
15-
issue: "https://github.com/elastic/elasticsearch/issues/109391"
16-
method: "testDeleteEndpointWhileReferencedByPipeline"
17-
- class: "org.elasticsearch.xpack.test.rest.XPackRestIT"
18-
issue: "https://github.com/elastic/elasticsearch/issues/109687"
19-
method: "test {p0=sql/translate/Translate SQL}"
20-
- class: "org.elasticsearch.xpack.esql.action.AsyncEsqlQueryActionIT"
21-
issue: "https://github.com/elastic/elasticsearch/issues/109944"
22-
method: "testBasicAsyncExecution"
23-
- class: "org.elasticsearch.action.admin.indices.rollover.RolloverIT"
24-
issue: "https://github.com/elastic/elasticsearch/issues/110034"
25-
method: "testRolloverWithClosedWriteIndex"
26-
- class: org.elasticsearch.xpack.transform.transforms.TransformIndexerTests
27-
method: testMaxPageSearchSizeIsResetToConfiguredValue
28-
issue: https://github.com/elastic/elasticsearch/issues/109844
29-
- class: org.elasticsearch.index.store.FsDirectoryFactoryTests
30-
method: testStoreDirectory
31-
issue: https://github.com/elastic/elasticsearch/issues/110210
32-
- class: org.elasticsearch.index.store.FsDirectoryFactoryTests
33-
method: testPreload
34-
issue: https://github.com/elastic/elasticsearch/issues/110211
35-
- class: "org.elasticsearch.rest.RestControllerIT"
36-
issue: "https://github.com/elastic/elasticsearch/issues/110225"
37-
- class: org.elasticsearch.upgrades.SecurityIndexRolesMetadataMigrationIT
38-
method: testMetadataMigratedAfterUpgrade
39-
issue: https://github.com/elastic/elasticsearch/issues/110232
40-
- class: org.elasticsearch.compute.lucene.ValueSourceReaderTypeConversionTests
41-
method: testLoadAll
42-
issue: https://github.com/elastic/elasticsearch/issues/110244
43-
- class: org.elasticsearch.backwards.SearchWithMinCompatibleSearchNodeIT
44-
method: testMinVersionAsNewVersion
45-
issue: https://github.com/elastic/elasticsearch/issues/95384
46-
- class: org.elasticsearch.backwards.SearchWithMinCompatibleSearchNodeIT
47-
method: testCcsMinimizeRoundtripsIsFalse
48-
issue: https://github.com/elastic/elasticsearch/issues/101974
49-
- class: "org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests"
50-
issue: "https://github.com/elastic/elasticsearch/issues/110408"
51-
method: "testCreateAndRestorePartialSearchableSnapshot"
52-
- class: "org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT"
53-
issue: "https://github.com/elastic/elasticsearch/issues/110591"
54-
- class: org.elasticsearch.packaging.test.DockerTests
55-
method: test600Interrupt
56-
issue: https://github.com/elastic/elasticsearch/issues/111324
57-
- class: org.elasticsearch.xpack.transform.integration.TransformIT
58-
method: testStopWaitForCheckpoint
59-
issue: https://github.com/elastic/elasticsearch/issues/106113
60-
- class: org.elasticsearch.index.mapper.IgnoredSourceFieldMapperTests
61-
method: testStoredNestedSubObjectWithNameOverlappingParentName
62-
issue: https://github.com/elastic/elasticsearch/issues/112083
63-
- class: org.elasticsearch.upgrades.FullClusterRestartIT
64-
method: testSnapshotRestore {cluster=UPGRADED}
65-
issue: https://github.com/elastic/elasticsearch/issues/111798
66-
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
67-
method: testDeleteExpiredData_RemovesUnusedState
68-
issue: https://github.com/elastic/elasticsearch/issues/116234
69-
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
70-
method: testPutE5Small_withPlatformAgnosticVariant
71-
issue: https://github.com/elastic/elasticsearch/issues/113983
72-
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
73-
method: testPutE5WithTrainedModelAndInference
74-
issue: https://github.com/elastic/elasticsearch/issues/114023
75-
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
76-
issue: https://github.com/elastic/elasticsearch/issues/112746
77-
- class: org.elasticsearch.xpack.ml.integration.ClassificationHousePricingIT
78-
method: testFeatureImportanceValues
79-
issue: https://github.com/elastic/elasticsearch/issues/116564
80-
- class: org.elasticsearch.packaging.test.DockerTests
81-
method: test021InstallPlugin
82-
issue: https://github.com/elastic/elasticsearch/issues/116147
2+
- class: "org.elasticsearch.upgrades.SearchStatesIT"
3+
issue: "https://github.com/elastic/elasticsearch/issues/108991"
4+
method: "testCanMatch"
5+
- class: "org.elasticsearch.upgrades.MlTrainedModelsUpgradeIT"
6+
issue: "https://github.com/elastic/elasticsearch/issues/108993"
7+
method: "testTrainedModelInference"
8+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
9+
method: test {yaml=reference/esql/esql-async-query-api/line_17}
10+
issue: https://github.com/elastic/elasticsearch/issues/109260
11+
- class: "org.elasticsearch.client.RestClientSingleHostIntegTests"
12+
issue: "https://github.com/elastic/elasticsearch/issues/102717"
13+
method: "testRequestResetAndAbort"
14+
- class: "org.elasticsearch.xpack.inference.InferenceCrudIT"
15+
issue: "https://github.com/elastic/elasticsearch/issues/109391"
16+
method: "testDeleteEndpointWhileReferencedByPipeline"
17+
- class: "org.elasticsearch.xpack.test.rest.XPackRestIT"
18+
issue: "https://github.com/elastic/elasticsearch/issues/109687"
19+
method: "test {p0=sql/translate/Translate SQL}"
20+
- class: "org.elasticsearch.xpack.esql.action.AsyncEsqlQueryActionIT"
21+
issue: "https://github.com/elastic/elasticsearch/issues/109944"
22+
method: "testBasicAsyncExecution"
23+
- class: "org.elasticsearch.action.admin.indices.rollover.RolloverIT"
24+
issue: "https://github.com/elastic/elasticsearch/issues/110034"
25+
method: "testRolloverWithClosedWriteIndex"
26+
- class: org.elasticsearch.xpack.transform.transforms.TransformIndexerTests
27+
method: testMaxPageSearchSizeIsResetToConfiguredValue
28+
issue: https://github.com/elastic/elasticsearch/issues/109844
29+
- class: org.elasticsearch.index.store.FsDirectoryFactoryTests
30+
method: testStoreDirectory
31+
issue: https://github.com/elastic/elasticsearch/issues/110210
32+
- class: org.elasticsearch.index.store.FsDirectoryFactoryTests
33+
method: testPreload
34+
issue: https://github.com/elastic/elasticsearch/issues/110211
35+
- class: "org.elasticsearch.rest.RestControllerIT"
36+
issue: "https://github.com/elastic/elasticsearch/issues/110225"
37+
- class: org.elasticsearch.upgrades.SecurityIndexRolesMetadataMigrationIT
38+
method: testMetadataMigratedAfterUpgrade
39+
issue: https://github.com/elastic/elasticsearch/issues/110232
40+
- class: org.elasticsearch.compute.lucene.ValueSourceReaderTypeConversionTests
41+
method: testLoadAll
42+
issue: https://github.com/elastic/elasticsearch/issues/110244
43+
- class: org.elasticsearch.backwards.SearchWithMinCompatibleSearchNodeIT
44+
method: testMinVersionAsNewVersion
45+
issue: https://github.com/elastic/elasticsearch/issues/95384
46+
- class: org.elasticsearch.backwards.SearchWithMinCompatibleSearchNodeIT
47+
method: testCcsMinimizeRoundtripsIsFalse
48+
issue: https://github.com/elastic/elasticsearch/issues/101974
49+
- class: "org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests"
50+
issue: "https://github.com/elastic/elasticsearch/issues/110408"
51+
method: "testCreateAndRestorePartialSearchableSnapshot"
52+
- class: "org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT"
53+
issue: "https://github.com/elastic/elasticsearch/issues/110591"
54+
- class: org.elasticsearch.packaging.test.DockerTests
55+
method: test600Interrupt
56+
issue: https://github.com/elastic/elasticsearch/issues/111324
57+
- class: org.elasticsearch.xpack.transform.integration.TransformIT
58+
method: testStopWaitForCheckpoint
59+
issue: https://github.com/elastic/elasticsearch/issues/106113
60+
- class: org.elasticsearch.index.mapper.IgnoredSourceFieldMapperTests
61+
method: testStoredNestedSubObjectWithNameOverlappingParentName
62+
issue: https://github.com/elastic/elasticsearch/issues/112083
63+
- class: org.elasticsearch.upgrades.FullClusterRestartIT
64+
method: testSnapshotRestore {cluster=UPGRADED}
65+
issue: https://github.com/elastic/elasticsearch/issues/111798
66+
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
67+
method: testDeleteExpiredData_RemovesUnusedState
68+
issue: https://github.com/elastic/elasticsearch/issues/116234
69+
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
70+
method: testPutE5Small_withPlatformAgnosticVariant
71+
issue: https://github.com/elastic/elasticsearch/issues/113983
72+
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
73+
method: testPutE5WithTrainedModelAndInference
74+
issue: https://github.com/elastic/elasticsearch/issues/114023
75+
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
76+
issue: https://github.com/elastic/elasticsearch/issues/112746
77+
- class: org.elasticsearch.xpack.ml.integration.ClassificationHousePricingIT
78+
method: testFeatureImportanceValues
79+
issue: https://github.com/elastic/elasticsearch/issues/116564
80+
- class: org.elasticsearch.packaging.test.DockerTests
81+
method: test021InstallPlugin
82+
issue: https://github.com/elastic/elasticsearch/issues/116147
8383

8484
# Examples:
8585
#

rest-api-spec/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
8484
task.skipTest("search/370_profile/fetch nested source", "profile output has changed")
8585
task.skipTest("search/240_date_nanos/doc value fields are working as expected across date and date_nanos fields", "Fetching docvalues field multiple times is no longer allowed")
8686
task.skipTest("search/110_field_collapsing/field collapsing and rescore", "#107779 Field collapsing is compatible with rescore in 8.15")
87+
task.skipTest("synonyms/90_synonyms_reloading_for_synset/Reload analyzers for specific synonym set", "Can't work until auto-expand replicas is 0-1 for synonyms index")
8788

8889
task.replaceValueInMatch("_type", "_doc")
8990
task.addAllowedWarningRegex("\\[types removal\\].*")

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

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
---
2-
"Reload analyzers for specific synonym set":
1+
setup:
32
- requires:
43
cluster_features: ["gte_v8.10.0"]
54
reason: Reloading analyzers for specific synonym set is introduced in 8.10.0
@@ -26,6 +25,14 @@
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+
index: .synonyms-2
32+
timeout: 2s
33+
wait_for_status: green
34+
ignore: 408
35+
2936
# Create my_index1 with synonym_filter that uses synonyms_set1
3037
- do:
3138
indices.create:
@@ -34,7 +41,6 @@
3441
settings:
3542
index:
3643
number_of_shards: 1
37-
number_of_replicas: 0
3844
analysis:
3945
filter:
4046
my_synonym_filter:
@@ -68,7 +74,6 @@
6874
settings:
6975
index:
7076
number_of_shards: 1
71-
number_of_replicas: 0
7277
analysis:
7378
filter:
7479
my_synonym_filter:
@@ -95,21 +100,25 @@
95100
- '{"index": {"_index": "my_index2", "_id": "2"}}'
96101
- '{"my_field": "goodbye"}'
97102

103+
---
104+
"Reload analyzers for specific synonym set":
105+
# These specific tests can't succeed in BwC, as synonyms auto-expand replicas are 0-all. Replicas can't be associated to
106+
# upgraded nodes, and thus we are not able to guarantee that the shards are not failed.
107+
# This test is skipped for BwC until synonyms index has auto-exapnd replicas set to 0-1.
98108

99-
# An update of synonyms_set1 must trigger auto-reloading of analyzers only for synonyms_set1
100109
- do:
101110
synonyms.put_synonym:
102111
id: synonyms_set1
103112
body:
104113
synonyms_set:
105114
- synonyms: "hello, salute"
106115
- synonyms: "ciao => goodbye"
116+
107117
- match: { result: "updated" }
108-
- match: { reload_analyzers_details._shards.total: 2 } # shard requests are still sent to 2 indices
109-
- match: { reload_analyzers_details._shards.successful: 2 }
110-
- length: { reload_analyzers_details.reload_details: 1 } # reload details contain only a single index
111-
- match: { reload_analyzers_details.reload_details.0.index: "my_index1" }
112-
- match: { reload_analyzers_details.reload_details.0.reloaded_analyzers.0: "my_analyzer1" }
118+
- gt: { reload_analyzers_details._shards.total: 0 }
119+
- gt: { reload_analyzers_details._shards.successful: 0 }
120+
- match: { reload_analyzers_details._shards.failed: 0 }
121+
113122

114123
# Confirm that the index analyzers are reloaded for my_index1
115124
- do:
@@ -122,6 +131,23 @@
122131
query: salute
123132
- match: { hits.total.value: 1 }
124133

134+
---
135+
"Check analyzer reloaded and non failed shards for bwc tests":
136+
137+
- do:
138+
synonyms.put_synonym:
139+
id: synonyms_set1
140+
body:
141+
synonyms_set:
142+
- synonyms: "hello, salute"
143+
- synonyms: "ciao => goodbye"
144+
- match: { result: "updated" }
145+
- gt: { reload_analyzers_details._shards.total: 0 }
146+
- gt: { reload_analyzers_details._shards.successful: 0 }
147+
- length: { reload_analyzers_details.reload_details: 1 } # reload details contain only a single index
148+
- match: { reload_analyzers_details.reload_details.0.index: "my_index1" }
149+
- match: { reload_analyzers_details.reload_details.0.reloaded_analyzers.0: "my_analyzer1" }
150+
125151
# Confirm that the index analyzers are still the same for my_index2
126152
- do:
127153
search:

0 commit comments

Comments
 (0)