Repository navigation
Fixes #34954: make the glossary hierarchy search IT independent of other tests - #35284
Merged
Merged
Conversation
…her tests The hierarchy search IT waited for "search(word) total == 30" over the whole shared index. Glossary search matches fuzzily and on name n-grams, so other tests' terms counted too and it failed in the parallel lane with 33. Its page and child-count checks had the same exposure, and it never cleaned up its terms. - No wait or global count: entity create indexes synchronously with a refresh, so the terms are searchable when create returns. - Every search is post-filtered to the test's own glossary. - The search word uses letters absent from all generated names, so parents can never match it or take a page slot from a match. - The glossary is hard-deleted recursively in finally. - Adds the same check for matches nested four levels deep.
…erarchy ITs The hierarchy search ITs depend on the shared glossary-term search settings, so take SEARCH_SETTINGS in READ mode: they never overlap a test that rewrites the settings under the READ_WRITE lock, and still run alongside other readers. A failed cleanup delete no longer fails a test whose assertions passed; the glossary is namespace-scoped.
Code Review ✅ Approved🟢 Low risk · The changes are confined to integration tests, improving hierarchy-search isolation and cleanup without altering production behavior. Test-only fix for the flaky VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledOptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
yan-3005
approved these changes
Oct 13, 2026
3 tasks done
sonika-shah
added a commit
that referenced
this pull request
Oct 13, 2026
… the hierarchy (#35221, #35284) (#35287) * Fixes #34954: keep the parent of every glossary search match in the hierarchy (#35221) Hierarchy search (getHierarchy=true) ranks matches and their parent terms in one page. With more matches than the page holds, the parents rank below the cut and buildGlossaryTermSearchHierarchy drops every match whose parent is missing, so the glossary comes back with no children. - Fetch the missing parents of the page's matches in one exact-FQN lookup after the cut (Approved only, same as the search). On failure, log and fall back to the previous behaviour. - Score the parent-term clauses 0 for glossary terms, so parents never take a page slot from a real match. Domain search is unchanged. Same change in the Elasticsearch and OpenSearch managers, plus an IT that fails without it. (cherry picked from commit cda0297) * Fixes #34954: make the glossary hierarchy search IT independent of other tests The hierarchy search IT waited for "search(word) total == 30" over the whole shared index. Glossary search matches fuzzily and on name n-grams, so other tests' terms counted too and it failed in the parallel lane with 33. Its page and child-count checks had the same exposure, and it never cleaned up its terms. - No wait or global count: entity create indexes synchronously with a refresh, so the terms are searchable when create returns. - Every search is post-filtered to the test's own glossary. - The search word uses letters absent from all generated names, so parents can never match it or take a page slot from a match. - The glossary is hard-deleted recursively in finally. - Adds the same check for matches nested four levels deep. (cherry picked from commit 72b7051) * Hold the search-settings read lock and make cleanup best-effort in hierarchy ITs The hierarchy search ITs depend on the shared glossary-term search settings, so take SEARCH_SETTINGS in READ mode: they never overlap a test that rewrites the settings under the READ_WRITE lock, and still run alongside other readers. A failed cleanup delete no longer fails a test whose assertions passed; the glossary is namespace-scoped. (cherry picked from commit 9bcc2ce)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes:
Fixes #34954
Test-only fix for a flaky IT added in #35221.
GlossaryTermResourceIT.test_hierarchySearchKeepsParentOfEveryMatchOnThePagefails in the merge queue's parallel lane:Why: it waited for
search(word)to return exactly 30 hits across the whole shared index. Glossary search matches fuzzily and onname.ngram(3–20 grams), so other tests' terms counted too. Its page and child-count assertions had the same exposure, and it never cleaned up.What changed (test only, no production code):
Refresh.True(SearchIndexHandler.isAsync()is false), so the terms are searchable when create returns.post_filteronglossary.name.keyword.@ResourceLock(SEARCH_SETTINGS, READ), so they never overlap a test that rewrites search settings under theREAD_WRITElock.finally, best-effort, so a cleanup hiccup cannot fail a passing test.test_hierarchySearchKeepsFullPathOfDeeplyNestedMatches).Type of change:
Tests:
GlossaryTermResourceITclass run concurrently passes (308 run, 0 failures) on MySQL + Elasticsearch 9.3.Why each assertion is now independent of other tests
post_filteron the test's glossary; Elasticsearch applies it before the top-N cutRefresh.True; nothing to wait forinitialEntityStatusis Approved when there are no reviewers; the test glossary has nonejknoqstuvwxyz) never occur in the hex/hier_*names, so no n-gram can match, even fuzzily; parents score 0@ResourceLock(SEARCH_SETTINGS, READ); writers holdREAD_WRITE, andSystemResourceIT/@Isolatedwriters never run alongsidefinally, best-effort