[OCISDEV-843][full-ci][tests-only] fix flaky search by re-querying the global search dropdown#13884
Open
dj4oC wants to merge 1 commit into
Open
[OCISDEV-843][full-ci][tests-only] fix flaky search by re-querying the global search dropdown#13884dj4oC wants to merge 1 commit into
dj4oC wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
13f2748 to
1bd39a6
Compare
…appear The "search list" assertions poll getDisplayedResourcesFromSearch, which only re-reads the global search dropdown DOM. The dropdown is populated by a single, debounced query (see `watch(term)` in SearchBar.vue) issued once when the search step runs. If a resource is still being indexed by tika at that moment, it never appears in the dropdown, and re-reading the same one-shot result list can never surface it — so the 30s poll dead-waits and times out. This is the root cause behind OCISDEV-843. The previous fixes worked around it for the single Unicode `strängéनेपालीName` case (extra sleeps, then moving that one assertion to the full results page / files list), but ~18 other `searchList` assertions still poll the one-shot dropdown and remain latently flaky. Re-issue the search on every poll iteration for the search list: clear and re-fill the existing keyword. Clearing forces a term change so the debounced watcher re-runs the query even for the same keyword, and not reloading the page preserves the active location filter. Each poll then reflects the current index state, so resources that finish indexing after the initial query are picked up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: David Walter <david.walter@kiteworks.com>
1bd39a6 to
dbf16b2
Compare
|
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.



Summary
userShouldSeeResourcesasserts on the global search dropdown (resourcePage.searchList) by pollinggetDisplayedResourcesFromSearch, which only re-reads the dropdown DOM. The dropdown is filled by a single, debounced query issued once when the search step runs (watch(term)→debouncedSearchinSearchBar.vue). If a resource is still being indexed by tika at that moment, it never lands in that one-shot result list — and re-reading the same DOM can never surface it. The 30s poll therefore just dead-waits and times out.This is the underlying cause of OCISDEV-843. The earlier fixes addressed only the single Unicode
strängéनेपालीNamecase (extrawaitForTimeouts, then moving that one assertion off the dropdown to the full results page / files list). The mechanism itself was never fixed, so the ~18 othersearchListassertions insearch.spec.ts/searchProjectSpace.spec.tsstill poll the one-shot dropdown and stay latently flaky.The failure is deterministic when indexing is slow — e.g. on the oCIS-side e2e job it failed on all four attempts:
Changes
reSearchAndGetDisplayedResourcesFromSearch: re-issues the global search by clearing and re-filling the existing keyword, then reads the dropdown. Clearing forces a term change so the debouncedwatch(term)re-runs the query even for the same keyword; not reloading the page preserves the active location filter.userShouldSeeResourcesnow uses it for thesearchListpoll, so every poll iteration reflects the current index state and resources that finish indexing after the initial query are picked up. Other list types are unchanged.This is a generic root-cause fix for all dropdown-based search assertions, not another per-test workaround.
Related Issue
Test plan
pnpm lint— passes (no new warnings/errors in the changed files)pnpm check:types(vue-tsc --noEmit) — passes[full-ci]is set so the search suite runs.🤖 Generated with Claude Code