Skip to content

lib: fix benchmark record acknowledgement race - #66430

Open
panva wants to merge 1 commit into
nodejs:mainfrom
panva:bench-ack-race
Open

panva wants to merge 1 commit into
nodejs:mainfrom
panva:bench-ack-race

Conversation

@panva

@panva panva commented Oct 1, 2026

Copy link
Copy Markdown
Member

The child can receive an acknowledgement and send its next record before the parent's send callback runs. Clear recordPending before sending the acknowledgement to avoid rejecting that record as an invalid sequence.

Add a regression test that delays send callbacks until the child sends its next record or closes.

https://ci.nodejs.org/job/node-test-binary-windows-js-suites/43703/RUN_SUBSET=0,nodes=win2022-COMPILED_BY-vs2022_clang/testReport/junit/(root)/parallel/test_bench_cli_backpressure/

The child can receive an acknowledgement and send its next record before
the parent's send callback runs. Clear recordPending before sending the
acknowledgement to avoid rejecting that record as an invalid sequence.

Add a regression test that delays send callbacks until the child sends
its next record or closes.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
@panva
panva requested a review from jasnell October 1, 2026 09:41
@panva panva added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label Oct 1, 2026
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 1, 2026
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.39%. Comparing base (cede7e6) to head (1becba6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66430   +/-   ##
=======================================
  Coverage   90.39%   90.39%           
=======================================
  Files         792      792           
  Lines      275697   275698    +1     
  Branches    52868    52854   -14     
=======================================
+ Hits       249208   249213    +5     
- Misses      16892    16896    +4     
+ Partials     9597     9589    -8     
Files with missing lines Coverage Δ
lib/internal/bench_runner/cli.js 94.15% <100.00%> (+<0.01%) ⬆️

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-test Issues and PRs involving tests that fail intermittently in CI. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants