Skip to content

test: avoid missing worker exit events - #65

Open
GrapeBaBa wants to merge 1 commit into
mainfrom
gr/worker-lifecycle-test
Open

test: avoid missing worker exit events#65
GrapeBaBa wants to merge 1 commit into
mainfrom
gr/worker-lifecycle-test

Conversation

@GrapeBaBa

Copy link
Copy Markdown
Contributor

Motivation

The worker lifecycle test waited for the worker message before registering its exit listener. Node can drain a queued message and emit exit in the same turn, causing the test to miss the exit event and time out intermittently in CI.

Description

  • Register the worker message and exit listeners before yielding.
  • Await both events together with node:events once(), which also propagates worker errors.
  • Assert a successful worker exit and check the restored refcount without an arbitrary delay.

Validated by running the worker lifecycle suite 50 consecutive times.

@GrapeBaBa
GrapeBaBa requested a review from nazarhussain July 27, 2026 13:17
@GrapeBaBa
GrapeBaBa marked this pull request as ready for review July 27, 2026 13:17
@matthewkeil matthewkeil moved this to Review Requested in Lodestar Team Coordination Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review Ready/Requested

Development

Successfully merging this pull request may close these issues.

2 participants