Skip to content

Commit

Permalink
Fix BwC synonyms tests (#118691)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest authored Dec 17, 2024
1 parent ce7a0c8 commit d09d57d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/117473
- class: org.elasticsearch.repositories.s3.RepositoryS3EcsClientYamlTestSuiteIT
issue: https://github.com/elastic/elasticsearch/issues/117525
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=synonyms/90_synonyms_reloading_for_synset/Reload analyzers for specific synonym set}
issue: https://github.com/elastic/elasticsearch/issues/116777
- class: "org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT"
method: "test {scoring.*}"
issue: https://github.com/elastic/elasticsearch/issues/117641
Expand Down
1 change: 1 addition & 0 deletions rest-api-spec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ tasks.named("yamlRestCompatTestTransform").configure ({ task ->
task.skipTest("search/520_fetch_fields/fetch _seq_no via fields", "error code is changed from 5xx to 400 in 9.0")
task.skipTest("search.vectors/41_knn_search_bbq_hnsw/Test knn search", "Scoring has changed in latest versions")
task.skipTest("search.vectors/42_knn_search_bbq_flat/Test knn search", "Scoring has changed in latest versions")
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")
})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
"Reload analyzers for specific synonym set":
setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Reloading analyzers for specific synonym set is introduced in 8.10.0

# Create synonyms_set1
- do:
synonyms.put_synonym:
Expand Down Expand Up @@ -100,21 +100,25 @@
- '{"index": {"_index": "my_index2", "_id": "2"}}'
- '{"my_field": "goodbye"}'

# An update of synonyms_set1 must trigger auto-reloading of analyzers only for synonyms_set1
---
"Reload analyzers for specific synonym set":
# These specific tests can't succeed in BwC, as synonyms auto-expand replicas are 0-all. Replicas can't be associated to
# upgraded nodes, and thus we are not able to guarantee that the shards are not failed.
# This test is skipped for BwC until synonyms index has auto-exapnd replicas set to 0-1.

- do:
synonyms.put_synonym:
id: synonyms_set1
body:
synonyms_set:
- synonyms: "hello, salute"
- synonyms: "ciao => goodbye"

- match: { result: "updated" }
- gt: { reload_analyzers_details._shards.total: 0 }
- gt: { reload_analyzers_details._shards.successful: 0 }
- match: { reload_analyzers_details._shards.failed: 0 }
- length: { reload_analyzers_details.reload_details: 1 } # reload details contain only a single index
- match: { reload_analyzers_details.reload_details.0.index: "my_index1" }
- match: { reload_analyzers_details.reload_details.0.reloaded_analyzers.0: "my_analyzer1" }


# Confirm that the index analyzers are reloaded for my_index1
- do:
Expand All @@ -127,6 +131,23 @@
query: salute
- match: { hits.total.value: 1 }

---
"Check analyzer reloaded and non failed shards for bwc tests":

- do:
synonyms.put_synonym:
id: synonyms_set1
body:
synonyms_set:
- synonyms: "hello, salute"
- synonyms: "ciao => goodbye"
- match: { result: "updated" }
- gt: { reload_analyzers_details._shards.total: 0 }
- gt: { reload_analyzers_details._shards.successful: 0 }
- length: { reload_analyzers_details.reload_details: 1 } # reload details contain only a single index
- match: { reload_analyzers_details.reload_details.0.index: "my_index1" }
- match: { reload_analyzers_details.reload_details.0.reloaded_analyzers.0: "my_analyzer1" }

# Confirm that the index analyzers are still the same for my_index2
- do:
search:
Expand Down

0 comments on commit d09d57d

Please sign in to comment.