Skip to content

test(node-integration-tests): Make runner completion event-driven instead of polling - #22085

Merged
mydea merged 1 commit into
developfrom
feat/node-it-event-completion
Jul 8, 2026
Merged

mydea merged 1 commit into
developfrom
feat/node-it-event-completion

Conversation

@mydea

@mydea mydea commented Jul 8, 2026

Copy link
Copy Markdown
Member

The test runner’s completed() and makeRequest() waited on a waitFor loop that polled a flag every 100ms. Because complete() (and the server-port parser) already flip their state synchronously the instant the expected envelope/port arrives, a test that had actually finished still idled up to a full poll tick before the runner noticed.

This replaces the two hot polling loops with deferred promises resolved directly by complete() and the port parser, raced against the existing timeouts. Same timeout / captured-log-dump / error behaviour — only the scheduling latency is removed.

Removes up to ~100ms (avg ~50ms) of idle wall-clock from every .completed() (hundreds of call sites) and from the first makeRequest of each server-based suite.

🤖 Generated with Claude Code

@mydea
mydea requested a review from a team as a code owner July 8, 2026 12:04
@mydea
mydea requested review from JPeer264 and andreiborza and removed request for a team July 8, 2026 12:04
@mydea

mydea commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Looking at runtimes for this specific PR, it does not immediately appear to be faster 😢 I think the change makes sense either way and is likely cleaner, so probably still good to merge from my POV.

…tead of polling

`completed()` and `makeRequest()` previously waited on a `waitFor` loop that
polled every 100ms, so a test that had actually finished still idled up to a
full poll tick before the runner noticed. Replace the two hot polling loops
with deferred promises that `complete()` and the server-port parser resolve
synchronously the instant they have a result, and race them against the
existing timeouts.

Removes up to ~100ms (avg ~50ms) of idle wall-clock from every `.completed()`
call and from the first `makeRequest` of each server-based suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the feat/node-it-event-completion branch from e2d78c9 to 6b8149d Compare July 8, 2026 12:47

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Neat, I like the new helper!

@mydea
mydea merged commit d37e494 into develop Jul 8, 2026
56 checks passed
@mydea
mydea deleted the feat/node-it-event-completion branch July 8, 2026 13:48
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