Skip to content

test_runner: avoid reusing V8 serializers - #65951

Open
inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:fix-test-runner-v8-serializer-reuse
Open

test_runner: avoid reusing V8 serializers#65951
inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:fix-test-runner-v8-serializer-reuse

Conversation

@inoway46

@inoway46 inoway46 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Serializer#releaseBuffer() documents that a serializer should not be used after its buffer has been released.

This change follows that contract by using a dedicated serializer for the header length and a new serializer for each test event.

This was found while investigating the intermittent Windows crash in the referenced issue and may be its cause.

Refs: #65756

A serializer must not be used after releaseBuffer() is called. Use a
dedicated instance to calculate the header length and create a new
serializer for each test event.

Add a regression test that serializes the same object twice and verifies
that both frames can be deserialized independently.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Codex
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Sep 10, 2026
@inoway46
inoway46 marked this pull request as ready for review September 10, 2026 06:19
@inoway46 inoway46 changed the title test_runner: avoid reusing v8 serializers test_runner: avoid reusing V8 serializers Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (43d3fe9) to head (de0cc63).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65951   +/-   ##
=======================================
  Coverage   90.16%   90.17%           
=======================================
  Files         771      771           
  Lines      265489   265490    +1     
  Branches    50471    50469    -2     
=======================================
+ Hits       239388   239414   +26     
+ Misses      17042    17007   -35     
- Partials     9059     9069   +10     
Files with missing lines Coverage Δ
lib/internal/test_runner/reporter/v8-serializer.js 100.00% <100.00%> (ø)

... and 31 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.

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants