test(web-pkg): raise timeout for flaky real web worker unit tests#13896
test(web-pkg): raise timeout for flaky real web worker unit tests#13896dj4oC wants to merge 2 commits into
Conversation
The webWorkers/*/worker.spec.ts tests spin up real web workers via useWebWorker and await their postMessage reply. Under heavy CI fork-parallelism the workers are starved and do not reply within vitest's 5s default, producing flaky "Test timed out in 5000ms" failures (the awaited callback never runs, so the webdav mock shows 0 calls). Raise testTimeout/hookTimeout to 20s for these five specs so they have enough headroom; fast runs are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: David Walter <david.walter@kiteworks.com>
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
✅ 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. |
There was a problem hiding this comment.
Pull request overview
Raises Vitest timeouts for unit specs that spin up real Web Workers in @ownclouders/web-pkg, reducing CI flakiness under heavy parallelism/fork contention.
Changes:
- Set per-file
vi.setConfig({ testTimeout: 20000, hookTimeout: 20000 })for affected real-worker spec suites. - Add brief in-file rationale comments explaining the increased headroom for CI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/tests/unit/composables/webWorkers/tokenTimerWorker/worker.spec.ts | Increases per-file Vitest timeouts for the real token timer worker tests. |
| packages/web-pkg/tests/unit/composables/webWorkers/restoreWorker/worker.spec.ts | Increases per-file Vitest timeouts for the real restore worker tests. |
| packages/web-pkg/tests/unit/composables/webWorkers/pasteWorker/worker.spec.ts | Increases per-file Vitest timeouts for the real paste worker tests. |
| packages/web-pkg/tests/unit/composables/webWorkers/exportAsPdfWorker/worker.spec.ts | Increases per-file Vitest timeouts for the real export-as-PDF worker tests. |
| packages/web-pkg/tests/unit/composables/webWorkers/deleteWorker/worker.spec.ts | Increases per-file Vitest timeouts for the real delete worker tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
LukasHirt
left a comment
There was a problem hiding this comment.
The last commit is not conventional.



Problem
The
packages/web-pkg/tests/unit/composables/webWorkers/*/worker.spec.tssuitesspin up real web workers (
useWebWorker(... ?worker)) andawaitthe worker'spostMessagereply. Under heavy CI fork-parallelism (e.g. when the fullvitestprojects run with many concurrent forks) the worker thread is starved anddoes not reply within vitest's 5s default
testTimeout. The result is flakyfailures like:
across
deleteWorker,pasteWorker,restoreWorkerandexportAsPdfWorker. Thetests pass locally and in lighter runs, so this is a timing/contention flake, not a
product bug.
Fix
Raise
testTimeout(andhookTimeout) to 20s for the five real-worker specs via aper-file
vi.setConfig. The timeout only affects tests that would otherwise exceed5s, so fast runs are unchanged; it simply gives the real workers enough headroom to
reply under CI load. The change is scoped to exactly the affected spec files.
Testing
pnpm --filter @ownclouders/web-pkg exec vitest run tests/unit/composables/webWorkers-> 15 files / 129 tests pass.