Skip to content

fix(html): raise testTimeout to 15s for parallel-load reliability#1448

Merged
cjpillsbury merged 1 commit intomainfrom
fix/html-test-timeout-under-parallel-load
Apr 23, 2026
Merged

fix(html): raise testTimeout to 15s for parallel-load reliability#1448
cjpillsbury merged 1 commit intomainfrom
fix/html-test-timeout-under-parallel-load

Conversation

@cjpillsbury
Copy link
Copy Markdown
Collaborator

@cjpillsbury cjpillsbury commented Apr 23, 2026

Summary

  • Raises testTimeout in packages/html/vitest.config.ts from Vitest's 5s default to 15s so define/* tests that dynamically await import() composite modules stay reliable when pnpm test runs at the workspace root.
  • Scoped to the html package — no workspace-wide config change.

Background

Under pnpm test at the workspace root, turbo (concurrency: 20) runs every package's vitest in parallel, and @videojs/spf additionally spawns Chromium via Playwright for its dom project. On a 10-core machine this is enough CPU contention that a single await import('../video/player') or await import('../video/skin') can exceed 5s through Vite's transform pipeline and time out — observed 5006ms, just past the default ceiling.

Same suites run in 1–2s in isolation (pnpm -F @videojs/html test) and under pnpm turbo run test --concurrency=1, which confirms the issue is scheduler starvation rather than a test bug. The ssr-safety test amplifies this because it calls vi.resetModules() in afterEach, so each case re-transforms the full graph with no cache benefit.

CI runs per-package in isolated jobs, so CI has never observed this. The problem is purely local to anyone whose machine can't absorb the parallel load within 5s.

Why 15s

Observed worst case is ~5s; 15s gives ~3x headroom under load. This doesn't mask regressions — a truly slow import would still fail, just at a higher threshold. The timeout is only consulted when a test exceeds it, so fast environments (CI, beefy laptops) pay nothing.

Alternatives considered

  • Lower turbo concurrency — would slow pnpm build and pnpm dev at root for everyone; too broad for a local-only problem.
  • Cap vitest workers per package — invasive change to every package's vitest config.
  • Leave it; run serially locally — fine, but the 5s cliff will keep biting new folks whose machines happen to land on the wrong side of it.

Test plan

  • pnpm -F @videojs/html test — 14 files, 101 tests, all pass (no change in isolated behavior)
  • pnpm turbo run test --force --filter='./packages/*' --filter='!@videojs/cli' reproduced under load — all 14 packages green, html runs at 11–19s wall duration with 30–50s cumulative transform time (confirms the contention is real; timeout bump absorbs it)
  • Two forced re-runs in a row, both clean

🤖 Generated with Claude Code


Note

Low Risk
Low risk: only adjusts Vitest configuration for the html package, with no production code or runtime behavior changes. Main impact is potentially slower feedback if a test hangs, since failures may take longer to time out.

Overview
Increases the @videojs/html Vitest testTimeout to 15s to prevent timeouts in define/* tests that perform heavy dynamic import() work when the workspace runs tests in parallel.

Adds inline documentation explaining the rationale (CPU contention during root pnpm test) and keeps the change scoped to packages/html.

Reviewed by Cursor Bugbot for commit 3a3c50d. Bugbot is set up for automated code reviews on this repo. Configure here.

Under `pnpm test` at the workspace root, turbo runs every package's
vitest in parallel (plus spf/dom which spawns Chromium via Playwright),
which can push dynamic `await import()` calls in the define/* tests
past the 5s default. Locally reproduced: src/define/tests/ssr-safety
and registration timed out at 5006ms on a 10-core machine; the same
suites pass in 1–2s when run in isolation or with turbo concurrency
capped.

Bumping the per-file timeout to 15s gives ~3x headroom over the worst
observed import under load without hiding real regressions — anything
approaching the new ceiling would still fail. The knob is scoped to
the html package so it doesn't touch other packages' configs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Apr 23, 2026 6:27pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 23, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 3a3c50d
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69ea6490d335310008e616e3
😎 Deploy Preview https://deploy-preview-1448--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 28.72 kB
/video (default + hls) 161.12 kB
/video (minimal) 26.25 kB
/video (minimal + hls) 158.87 kB
/audio (default) 26.64 kB
/audio (minimal) 24.21 kB
/background 4.16 kB
Media (8)
Entry Size
/media/background-video 1.04 kB
/media/container 1.72 kB
/media/dash-video 236.54 kB
/media/hls-video 134.01 kB
/media/mux-audio 160.06 kB
/media/mux-video 160.07 kB
/media/native-hls-video 3.77 kB
/media/simple-hls-video 15.80 kB
Players (3)
Entry Size
/video/player 7.04 kB
/audio/player 5.12 kB
/background/player 3.86 kB
Skins (29)
Entry Type Size
/video/minimal-skin.css css 3.50 kB
/video/skin.css css 3.53 kB
/video/minimal-skin js 26.26 kB
/video/minimal-skin.tailwind js 26.48 kB
/video/skin js 28.76 kB
/video/skin.tailwind js 28.88 kB
/audio/minimal-skin.css css 2.54 kB
/audio/skin.css css 2.50 kB
/audio/minimal-skin js 24.20 kB
/audio/minimal-skin.tailwind js 24.40 kB
/audio/skin js 26.64 kB
/audio/skin.tailwind js 26.78 kB
/background/skin.css css 117 B
/background/skin js 1.14 kB
/live-video/minimal-skin.css css 3.50 kB
/live-video/skin.css css 3.53 kB
/live-video/minimal-skin js 26.04 kB
/live-video/minimal-skin.tailwind js 26.07 kB
/live-video/skin js 28.45 kB
/live-video/skin.tailwind js 28.52 kB
/live-audio/minimal-skin.css css 2.54 kB
/live-audio/skin.css css 2.50 kB
/live-audio/minimal-skin js 23.99 kB
/live-audio/minimal-skin.tailwind js 23.99 kB
/live-audio/skin js 26.35 kB
/live-audio/skin.tailwind js 26.42 kB
/base.css css 157 B
/shared.css css 88 B
/skin-element js 1.36 kB
UI Components (25)
Entry Size
/ui/alert-dialog 1.00 kB
/ui/alert-dialog-close 467 B
/ui/alert-dialog-description 423 B
/ui/alert-dialog-title 420 B
/ui/buffering-indicator 2.50 kB
/ui/captions-button 2.67 kB
/ui/cast-button 2.66 kB
/ui/compounds 4.20 kB
/ui/controls 2.33 kB
/ui/error-dialog 3.07 kB
/ui/fullscreen-button 2.70 kB
/ui/hotkey 1.94 kB
/ui/mute-button 2.67 kB
/ui/pip-button 2.71 kB
/ui/play-button 2.68 kB
/ui/playback-rate-button 2.66 kB
/ui/popover 1.83 kB
/ui/poster 2.28 kB
/ui/seek-button 2.69 kB
/ui/slider 1.50 kB
/ui/thumbnail 2.92 kB
/ui/time 2.54 kB
/ui/time-slider 3.94 kB
/ui/tooltip 2.02 kB
/ui/volume-slider 2.66 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 23.48 kB
/video (default + hls) 154.91 kB
/video (minimal) 21.11 kB
/video (minimal + hls) 152.51 kB
/audio (default) 19.06 kB
/audio (minimal) 17.61 kB
/background 755 B
Media (7)
Entry Size
/media/background-video 575 B
/media/dash-video 235.04 kB
/media/hls-video 132.49 kB
/media/mux-audio 158.70 kB
/media/mux-video 158.57 kB
/media/native-hls-video 2.26 kB
/media/simple-hls-video 14.36 kB
Skins (26)
Entry Type Size
/video/minimal-skin.css css 3.44 kB
/video/skin.css css 3.46 kB
/video/minimal-skin js 21.04 kB
/video/minimal-skin.tailwind js 24.53 kB
/video/skin js 23.40 kB
/video/skin.tailwind js 24.66 kB
/audio/minimal-skin.css css 2.44 kB
/audio/skin.css css 2.39 kB
/audio/minimal-skin js 17.52 kB
/audio/minimal-skin.tailwind js 20.04 kB
/audio/skin js 18.98 kB
/audio/skin.tailwind js 19.97 kB
/background/skin.css css 90 B
/background/skin js 272 B
/live-video/minimal-skin.css css 3.44 kB
/live-video/skin.css css 3.46 kB
/live-video/minimal-skin js 17.74 kB
/live-video/minimal-skin.tailwind js 21.15 kB
/live-video/skin js 20.14 kB
/live-video/skin.tailwind js 21.32 kB
/live-audio/minimal-skin.css css 2.44 kB
/live-audio/skin.css css 2.39 kB
/live-audio/minimal-skin js 15.72 kB
/live-audio/minimal-skin.tailwind js 18.03 kB
/live-audio/skin js 17.21 kB
/live-audio/skin.tailwind js 18.12 kB
UI Components (20)
Entry Size
/ui/alert-dialog 1.09 kB
/ui/buffering-indicator 1.79 kB
/ui/captions-button 2.02 kB
/ui/cast-button 2.04 kB
/ui/controls 1.76 kB
/ui/error-dialog 2.25 kB
/ui/fullscreen-button 2.06 kB
/ui/mute-button 2.03 kB
/ui/pip-button 2.00 kB
/ui/play-button 1.99 kB
/ui/playback-rate-button 1.89 kB
/ui/popover 1.86 kB
/ui/poster 1.67 kB
/ui/seek-button 2.10 kB
/ui/slider 2.66 kB
/ui/thumbnail 2.07 kB
/ui/time 2.06 kB
/ui/time-slider 2.36 kB
/ui/tooltip 2.17 kB
/ui/volume-slider 3.18 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (9)
Entry Size
. 4.96 kB
/dom 11.87 kB
/dom/media/custom-media-element 1.90 kB
/dom/media/dash 234.13 kB
/dom/media/google-cast 4.07 kB
/dom/media/hls 131.85 kB
/dom/media/mux 158.10 kB
/dom/media/native-hls 1.61 kB
/dom/media/simple-hls 13.73 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 996 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.39 kB
/html 695 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.92 kB
/events 319 B
/function 327 B
/object 275 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 40 B
/dom 13.33 kB
/playback-engine 13.24 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

Copy link
Copy Markdown
Collaborator

@luwes luwes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cjpillsbury cjpillsbury merged commit b934937 into main Apr 23, 2026
26 checks passed
@cjpillsbury cjpillsbury deleted the fix/html-test-timeout-under-parallel-load branch April 23, 2026 21:44
@luwes luwes mentioned this pull request Apr 23, 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