Skip to content

Fix & Test for WorkerPool Initialization Race#598

Merged
amadeus merged 2 commits intomainfrom
amadeus/worker-pool-init-error
Apr 22, 2026
Merged

Fix & Test for WorkerPool Initialization Race#598
amadeus merged 2 commits intomainfrom
amadeus/worker-pool-init-error

Conversation

@amadeus
Copy link
Copy Markdown
Member

@amadeus amadeus commented Apr 22, 2026

Created a regression test for the race WorkerPool initialization/termination/initialization case. Then created a fix that better handles the various async states that can occur.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

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

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Apr 22, 2026 11:29pm
pierrejs-docs Ready Ready Preview Apr 22, 2026 11:29pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10b4ffb61b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +55 to +57
if (originalRequestAnimationFrame != null) {
globalThis.requestAnimationFrame = originalRequestAnimationFrame;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset RAF globals when originals are undefined

This teardown only restores requestAnimationFrame when an original function existed, so in Bun/Node test environments where it starts as undefined, the shim remains installed after this file finishes. That leaks fake RAF behavior into later test files and can cause order-dependent failures. The same pattern is used for cancelAnimationFrame, so both globals should be explicitly reset (or deleted) in the else path.

Useful? React with 👍 / 👎.

@amadeus amadeus merged commit 25e6842 into main Apr 22, 2026
10 checks passed
@amadeus amadeus deleted the amadeus/worker-pool-init-error branch April 22, 2026 23:36
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.

1 participant