test(e2e): wait for upload processing to clear before returning - #559
Open
LukasHirt wants to merge 1 commit into
Open
test(e2e): wait for upload processing to clear before returning#559LukasHirt wants to merge 1 commit into
LukasHirt wants to merge 1 commit into
Conversation
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>
✅ 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. |
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
web-app-ai-multi-doc-synthesizer'sacceptance.spec.ts, first observed in CI: https://github.com/owncloud/web-extensions/actions/runs/32374559021/job/96443137621?pr=557processingstate for a short while (e.g. content indexing), during whichweb-pkg'sResourceTabledisables the row's selection checkbox. The sharedFilesAppBar.uploadFile()test helper only waited for the upload's HTTP response, not for that processing state to clear, so callers race against it."Synthesize" is hidden when fewer than 2 files are selected—check({ 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-forceselectAllCheckbox.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".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:typesandeslinton the changed filesupport/actions/) and stress-tested the two previously-flaky tests 5x each on webkit: 10/10 passedweb-app-ai-multi-doc-synthesizere2e suite across chrome/firefox/webkit: 33/33 passed