Skip to content

fix: use process.stdout.write for timing markers to bypass Vitest interception#1313

Closed
Saga4 wants to merge 1 commit intomainfrom
fix/stdout-write-vitest
Closed

fix: use process.stdout.write for timing markers to bypass Vitest interception#1313
Saga4 wants to merge 1 commit intomainfrom
fix/stdout-write-vitest

Conversation

@Saga4
Copy link
Contributor

@Saga4 Saga4 commented Feb 3, 2026

Summary

  • Changes capturePerf timing markers from console.log to process.stdout.write
  • Ensures timing markers are always captured by the parent process

Problem

Vitest intercepts console.log output and may not pass it to the subprocess stdout. This caused timing markers in capturePerf to not be captured by the parent process, resulting in "overall summed benchmark runtime is 0" errors.

Solution

Changed from:

console.log(`!######${testStdoutTag}:${durationNs}######!`);

To:

process.stdout.write(`!######${testStdoutTag}:${durationNs}######!\n`);

process.stdout.write writes directly to the stdout stream, bypassing any console interceptors.

Test plan

  • Added test file runtime/__tests__/stdout-write.test.js
  • Test verifies timing markers use process.stdout.write
  • Test verifies markers are NOT using console.log
  • Manual testing with Vitest-based projects

Generated with Claude Code

…erception

Vitest intercepts console.log output and may not pass it to the
subprocess stdout. This caused timing markers in capturePerf to
not be captured by the parent process.

Changed from console.log to process.stdout.write for timing markers
in capturePerf to ensure markers are always written directly to stdout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Saga4
Copy link
Contributor Author

Saga4 commented Feb 3, 2026

Closing - needs more verification before merging

@Saga4 Saga4 closed this Feb 3, 2026
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