(test): pin the own pid in the procstart batch tests (#426) - #428
Merged
Merged
Conversation
The tests write descriptors for pids 1000..1066 and init() defaults ownPid to process.pid, so a runner whose test process lands in that range had one candidate excluded as its own: 2 !== 3 and 66 !== 67 on Windows CI. Closes #426
devsuitup
commented
Oct 3, 2026
devsuitup
left a comment
Owner
Author
There was a problem hiding this comment.
Review at 78803a9: 0 blocking. The root cause holds. init() defaults ownPid to process.pid (cli-session-state.js:126), and the own-process filter drops a descriptor with that pid. The tests write pids 1000-1066, so a runner pid in that range drops one candidate. Forcing process.pid to 1066 or 1010 reproduces 2 !== 3 and 66 !== 67 on the old test. ownPid: -1 is truthy, so it passes the || default. The change is test-only, and the production exclusion is intended.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #426
Cause
test/cli-session-procstart-batch.test.jsbootscli-session-statewithout pinningownPid.init()defaults it toprocess.pid(cli-session-state.js:126), andownProcessFilter/descendsFromThisProcess(cli-session-state.js:63-70, 357) exclude any descriptor whose pid equals it. The two failing tests write descriptors for pids 1000..1066. On a Windows runner the test process's own pid can fall in that range, so one candidate is treated as "ours" and removed from the result: 2 instead of 3 on the Windows-cap test, 66 instead of 67 on the Linux-branch test. A rerun gets another pid and passes. Not a production bug: excluding the app's own process is intended.Proof
Forcing
process.pidwith a--requirepreload on the unmodified test:2 !== 3,66 !== 67).With
ownPid: -1in the test'sinitcalls, both tests pass for pids 1066, 1010, 1000 and 4242 (only the unrelated real-creation-time test fails under a faked pid, as expected).Fix
Test only: pass
ownPid: -1inboot()and in the "no probe is spawned" test.Runs
30/30 green of the file under Node 22 + c8.
task check: 119 pass, 0 fail, 1 skipped.