Skip to content

test(e2e): wait for upload processing to clear before returning - #559

Open
LukasHirt wants to merge 1 commit into
mainfrom
test/flaky-multi-doc-synthesizer-e2e
Open

test(e2e): wait for upload processing to clear before returning#559
LukasHirt wants to merge 1 commit into
mainfrom
test/flaky-multi-doc-synthesizer-e2e

Conversation

@LukasHirt

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes a webkit-only flaky test in web-app-ai-multi-doc-synthesizer's acceptance.spec.ts, first observed in CI: https://github.com/owncloud/web-extensions/actions/runs/32374559021/job/96443137621?pr=557
  • Root cause: oCIS keeps a freshly uploaded resource in a server-side processing state for a short while (e.g. content indexing), during which web-pkg's ResourceTable disables the row's selection checkbox. The shared FilesAppBar.uploadFile() test helper only waited for the upload's HTTP response, not for that processing state to clear, so callers race against it.
  • That race produced two related failures:
    • "Synthesize" is hidden when fewer than 2 files are selectedcheck({ force: true }) bypasses Playwright's normal wait-for-enabled retry, so it failed outright ("Clicking the checkbox did not change its state") while the checkbox was still disabled.
    • synthesis modal displays shared themes section — the non-force selectAllCheckbox.check() silently retried against the same disabled checkbox, burning most of the 30s test timeout before the following .click() on the Synthesize button ran out of budget, surfacing as "Target page, context or browser has been closed".
  • Fix: uploadFile() now waits for the just-uploaded resource's row checkbox to become enabled before returning. This is a shared helper used by ~12 extension e2e suites, so it addresses the race everywhere it can occur, not just in this one spec.

Test plan

  • pnpm --filter web-app-ai-multi-doc-synthesizer check:types and eslint on the changed file
  • Reproduced CI's setup locally (standalone oCIS container, matching support/actions/) and stress-tested the two previously-flaky tests 5x each on webkit: 10/10 passed
  • Ran the full web-app-ai-multi-doc-synthesizer e2e suite across chrome/firefox/webkit: 33/33 passed

In web-app-ai-multi-doc-synthesizer's acceptance.spec.ts, two webkit-only
tests were flaky:

- "Synthesize is hidden when fewer than 2 files are selected" failed with
  "Clicking the checkbox did not change its state" — the row checkbox was
  still `disabled` because oCIS keeps a freshly uploaded resource in a
  `processing` state for a short while, and web-pkg's ResourceTable
  disables the selection checkbox while `resource.processing === true`.
  `check({ force: true })` bypasses Playwright's normal wait-for-enabled
  retry, so it failed outright instead of waiting it out.

- "synthesis modal displays shared themes section" failed with "Target
  page, context or browser has been closed" after a 30s timeout. Its
  non-force `selectAllCheckbox.check()` silently retried against the same
  disabled checkbox, burning most of the test timeout before the
  following `.click()` on the Synthesize button ran out of budget.

FilesAppBar.uploadFile() only waited for the upload's HTTP response, not
for the uploaded resource to leave its server-side "processing" state.
Wait for the just-uploaded resource's row checkbox to become enabled
before returning, so every caller of this shared helper (all AI
extensions' e2e suites) can safely select a resource right after upload
instead of racing against it.

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt requested a review from a team as a code owner August 20, 2026 16:53
@kw-security

kw-security commented Aug 20, 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)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

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

@LukasHirt LukasHirt self-assigned this Aug 20, 2026
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