Skip to content

fix(test): raise integration-supabase hookTimeout for preflight contention (PP-2on.3) - #1313

Merged
timothyfroehlich merged 2 commits into
mainfrom
fix/PP-2on.3-pglite-hooktimeout
May 12, 2026
Merged

fix(test): raise integration-supabase hookTimeout for preflight contention (PP-2on.3)#1313
timothyfroehlich merged 2 commits into
mainfrom
fix/PP-2on.3-pglite-hooktimeout

Conversation

@timothyfroehlich

Copy link
Copy Markdown
Owner

Summary

  • Raises hookTimeout on the integration-supabase vitest project from the default 10s to 30s, so PGlite WASM init in setupTestDb()'s beforeAll doesn't time out when preflight runs test:integration and test:integration:supabase in parallel.
  • Surgical, scoped to one project — getTestDb() is memoized per worker, so the cost is paid once per worker regardless of headroom.

Root cause

preflight runs the two integration projects with npm-run-all --parallel, so both spin up vitest workers that each create their own PGlite (WASM Postgres) instance. Under that CPU/IO contention, first-call init in getTestDb() regularly exceeds the default 10s, causing 4 specs (images.test.ts, issue-filtering.test.ts, issues.test.ts, machine-text-fields.test.ts) to fail with Hook timed out in 10000ms at src/test/setup/pglite.ts:84. The same suite passes cleanly when run solo immediately afterward.

Verification

  • pnpm run test:integration:supabase solo: 14 files / 105 tests passed in 3.26s
  • npm-run-all --parallel test:integration test:integration:supabase (the exact preflight sub-block): both projects passed; integration-supabase took 11.35s wall-clock — past the old 10s default, comfortably inside the new 30s.
  • pnpm run check: 116 files / 1034 tests, all linters green.

Test plan

  • Solo run of test:integration:supabase passes
  • Parallel preflight-shaped run of both integration projects passes
  • pnpm run check clean
  • CI Gate passes
  • Reviewer (Copilot) addressed

🤖 Generated with Claude Code

…ntion (PP-2on.3)

Preflight runs `test:integration` and `test:integration:supabase` in parallel.
Both projects spin up vitest workers that each create their own PGlite (WASM
Postgres) instance, so the first-call `getTestDb()` inside `setupTestDb()`'s
`beforeAll` competes for CPU/IO. Under that contention, init can exceed the
default 10s vitest `hookTimeout`, causing the integration-supabase project
to fail intermittently during full preflight — even though the suite passes
cleanly when invoked in isolation immediately afterward.

Raises `hookTimeout` to 30s for the integration-supabase project only. The
underlying init cost is unchanged; this just gives the WASM bring-up enough
headroom to complete under parallel pressure. `getTestDb()` remains memoized
per worker, so the cost is paid once per worker, not per test file.

Verified locally: `pnpm run test:integration:supabase` solo passes in 3.26s;
the preflight-shaped parallel block (`npm-run-all --parallel test:integration
test:integration:supabase`) passes with integration-supabase at 11.35s
wall-clock — past the old 10s default, comfortably inside the new 30s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 12, 2026 02:23
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment May 12, 2026 3:26am

@supabase

supabase Bot commented May 12, 2026

Copy link
Copy Markdown

Updates to Preview Branch (fix/PP-2on.3-pglite-hooktimeout) ↗︎

Deployments Status Updated
Database Tue, 12 May 2026 03:13:24 UTC
Services Tue, 12 May 2026 03:13:24 UTC
APIs Tue, 12 May 2026 03:13:24 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Tue, 12 May 2026 03:13:25 UTC
Migrations Tue, 12 May 2026 03:13:25 UTC
Seeding Tue, 12 May 2026 03:13:25 UTC
Edge Functions Tue, 12 May 2026 03:13:25 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Raises the Vitest hook timeout for the integration-supabase project to reduce flaky beforeAll timeouts during preflight, where test:integration and test:integration:supabase run in parallel and contend during PGlite WASM initialization.

Changes:

  • Set hookTimeout: 30000 for the integration-supabase Vitest project.
  • Documented why the higher timeout is needed under parallel preflight contention.

@timothyfroehlich
timothyfroehlich merged commit 453dfec into main May 12, 2026
23 checks passed
@timothyfroehlich
timothyfroehlich deleted the fix/PP-2on.3-pglite-hooktimeout branch May 12, 2026 04:10
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