Skip to content

[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
owncloud:masterfrom
dj4oC:fix/e2e/search-dropdown-requery
Open

[OCISDEV-843][full-ci][tests-only] fix flaky search by re-querying the global search dropdown#13884
dj4oC wants to merge 1 commit into
owncloud:masterfrom
dj4oC:fix/e2e/search-dropdown-requery

Conversation

@dj4oC

@dj4oC dj4oC commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

userShouldSeeResources asserts on the global search dropdown (resourcePage.searchList) by polling getDisplayedResourcesFromSearch, 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)debouncedSearch in SearchBar.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éनेपालीName case (extra waitForTimeouts, then moving that one assertion off the dropdown to the full results page / files list). The mechanism itself was never fixed, so the ~18 other searchList assertions in search.spec.ts / searchProjectSpace.spec.ts still 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:

✘ search.spec.ts › Search › Search in personal spaces  (+ retry #1, #2, #3)
Error: Waiting for resource "strängéनेपालीName" to appear in search list
- Timeout 30000ms exceeded while waiting on the predicate   (resources.ts:205)

Changes

  • Add 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 debounced watch(term) re-runs the query even for the same keyword; not reloading the page preserves the active location filter.
  • userShouldSeeResources now uses it for the searchList poll, 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
  • CI runs the e2e search suite against a live backend — note: the full e2e suite requires a running oCIS + tika deployment and was not run locally; this PR relies on CI as the e2e gate. [full-ci] is set so the search suite runs.

🤖 Generated with Claude Code

@kw-security

kw-security commented Jun 13, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@dj4oC dj4oC force-pushed the fix/e2e/search-dropdown-requery branch from 13f2748 to 1bd39a6 Compare June 13, 2026 20:00
…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>
@dj4oC dj4oC force-pushed the fix/e2e/search-dropdown-requery branch from 1bd39a6 to dbf16b2 Compare June 13, 2026 20:05
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants