Skip to content

ci: run multi-worker exactly-once test in e2e-restart-recovery (postgres)#2571

Open
pranaygp wants to merge 1 commit into
pgp/world-start-recoveryfrom
pgp/world-start-recovery-multiworker-ci
Open

ci: run multi-worker exactly-once test in e2e-restart-recovery (postgres)#2571
pranaygp wants to merge 1 commit into
pgp/world-start-recoveryfrom
pgp/world-start-recovery-multiworker-ci

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Stacked on #2544.

What

Enables MULTIWORKER_RECOVERY_TEST=1 on the postgres entry of the e2e-restart-recovery job so the multi-worker exactly-once guarantee test (added in #2544, currently gated off CI) runs in CI.

The test it wires up

packages/core/e2e/restart-recovery.test.ts"a worker booting does not re-run a step already executing on another worker":

  1. Worker B runs a workflow whose only work is one long step (sideEffectStepWorkflow); the step records each execution of its body to a shared side-effect log.
  2. Worker A boots while the step is still in flight on B — its startup wiring (ensureWorldStarted → reenqueueActiveRuns) re-drives all active runs, including this healthy one.
  3. The test counts how many times the step body actually ran.

It asserts the step body executes exactly once — proving boot-time recovery does not duplicately execute a step that's healthily in-flight on another worker (the correlationId idempotency key + the step's terminal-state guard hold even when another worker re-enqueues the run).

Why postgres-only

The duplicate-execution concern only applies to a shared DB + graphile-worker pool. The local matrix entry skips the test via its own world gate (WORKFLOW_TARGET_WORLD === '@workflow/world-postgres'), so this only affects the postgres entry.

Verification

Run locally against a postgres container:

Re-enqueued 1 active run(s) on startup   ← worker A re-drove the in-flight run
step body executed 1 time(s)             ← exactly-once

Test passes, VITEST EXIT 0 (robust process-group + lsof teardown so the worker exits cleanly). Adds ~25s + a second server to the postgres entry.

🤖 Generated with Claude Code

…ostgres)

Enable MULTIWORKER_RECOVERY_TEST on the postgres entry of the
e2e-restart-recovery job so the multi-worker guarantee test runs in CI. It
boots a second worker while a step is in flight on the first and asserts the
step body executes exactly once (no duplicate from reenqueueActiveRuns). The
local matrix entry skips it via the test's own world gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 22, 2026 21:11
@pranaygp pranaygp requested a review from a team as a code owner June 22, 2026 21:11
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 20de3b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Error Error Jun 22, 2026 9:15pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 22, 2026 9:15pm
example-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-astro-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-express-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-fastify-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-hono-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-nitro-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workbench-vite-workflow Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jun 22, 2026 9:15pm
workflow-swc-playground Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workflow-tarballs Ready Ready Preview, Comment Jun 22, 2026 9:15pm
workflow-web Ready Ready Preview, Comment Jun 22, 2026 9:15pm

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1292 1 227 1520
✅ 💻 Local Development 1909 0 219 2128
✅ 📦 Local Production 1909 0 219 2128
✅ 🐘 Local Postgres 1895 0 233 2128
✅ 🪟 Windows 152 0 0 152
✅ 📋 Other 890 0 180 1070
Total 8047 1 1078 9126

❌ Failed Tests

▲ Vercel Production (1 failed)

vite (1 failed):

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 125 0 27
✅ example 125 0 27
✅ express 125 0 27
✅ fastify 125 0 27
✅ hono 125 0 27
✅ nextjs-webpack 149 0 3
✅ nitro 125 0 27
✅ nuxt 125 0 27
✅ sveltekit 144 0 8
❌ vite 124 1 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 127 0 25
✅ express-stable 127 0 25
✅ fastify-stable 127 0 25
✅ hono-stable 127 0 25
✅ nextjs-turbopack-canary 133 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 152 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 152 0 0
✅ nextjs-webpack-canary 133 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 152 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 152 0 0
✅ nitro-stable 127 0 25
✅ nuxt-stable 127 0 25
✅ sveltekit-stable 146 0 6
✅ vite-stable 127 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 127 0 25
✅ express-stable 127 0 25
✅ fastify-stable 127 0 25
✅ hono-stable 127 0 25
✅ nextjs-turbopack-canary 133 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 152 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 152 0 0
✅ nextjs-webpack-canary 133 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 152 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 152 0 0
✅ nitro-stable 127 0 25
✅ nuxt-stable 127 0 25
✅ sveltekit-stable 146 0 6
✅ vite-stable 127 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 126 0 26
✅ express-stable 126 0 26
✅ fastify-stable 126 0 26
✅ hono-stable 126 0 26
✅ nextjs-turbopack-canary 132 0 20
✅ nextjs-turbopack-stable-lazy-discovery-disabled 151 0 1
✅ nextjs-turbopack-stable-lazy-discovery-enabled 151 0 1
✅ nextjs-webpack-canary 132 0 20
✅ nextjs-webpack-stable-lazy-discovery-disabled 151 0 1
✅ nextjs-webpack-stable-lazy-discovery-enabled 151 0 1
✅ nitro-stable 126 0 26
✅ nuxt-stable 126 0 26
✅ sveltekit-stable 145 0 7
✅ vite-stable 126 0 26
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 152 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 127 0 25
✅ e2e-local-dev-tanstack-start- 127 0 25
✅ e2e-local-postgres-nest-stable 126 0 26
✅ e2e-local-postgres-tanstack-start- 126 0 26
✅ e2e-local-prod-nest-stable 127 0 25
✅ e2e-local-prod-tanstack-start- 127 0 25
✅ e2e-restart-recovery-local 2 0 1
✅ e2e-restart-recovery-postgres 3 0 0
✅ e2e-vercel-prod-tanstack-start 125 0 27

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Restart Recovery: success
  • Windows: success

Check the workflow run for details.

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