Repository navigation
test(platform): use unallocatable listener pids - #12672
Conversation
|
Intent: Make main comply with the existing mock-PID isolation rule while preserving the Windows TCP-owner test's exact-loopback versus wildcard discrimination. Maintainers: please approve the fork workflows when convenient. GPT and Opus both verified exact head |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 2d9f62b |
|
fixed — span=ccb546b96bf3
|
|
rebutted — span=3ec4969f47f8
|
|
The sole red is unrelated to this four-line Python test-data change: Electron's real-junction PowerShell/WMIC probe timed out while all 31 sibling tests passed. It is now tracked with a second occurrence and direct job evidence in #12685. No repush performed. |
4689140 to
0b518b3
Compare
|
Maintainer action requested for rebased head |
0b518b3 to
d819bf0
Compare
|
Maintainer action requested for healed-main head |
7089b8f to
7351b3a
Compare
7351b3a to
f7f5450
Compare
f7f5450 to
67088de
Compare
67088de to
2d9f62b
Compare
cixuuz
left a comment
There was a problem hiding this comment.
Approve: test-only. Switches the fake listener PIDs to unallocatable large values (99_999_999_99x) so the platform-compat test can never collide with a real listener PID on the host. Logic and assertions unchanged; behavior-preserving. All lanes clean at this head.
Problem / Motivation
test/test_platform_compat.pycontains three fabricated Windows TCP-owner PIDs that a live process can own. Thekirocrew.mock-pid-allocatableSAST rule correctly rejects them, reddening diff-aware scans for older-baseline PRs even though the test only exercises address filtering.Why it matters
An allocatable mock PID can target an unrelated runner process if it reaches cleanup code, and the main-side violations also create false ownership of SAST failures on unrelated pull requests.
What changed (motivation → approach → change)
Replaced the three mocked TCP table PIDs and the exact-loopback expected value in
test/test_platform_compat.pywith three distinct literals above every supported platform's PID range. Distinct values preserve the assertion that only the IPv4 loopback row is selected while wildcard IPv4 and IPv6 rows are excluded.Backwards compatibility
Compatible: production code is unchanged; only fabricated test data changes.
Tests
test/test_platform_compat.py: 452 passed, 27 platform skips (rebased head2d9f62b2fon main7b2da39c5).mock-pid-allocatablefindings; repaired file reports zero.Manual verification
N/A — static-rule proof and platform compatibility tests cover the test-data correction.
Related Issues
Fixes #12669
Pattern harvest
Rule candidate: semgrep
Pattern:
kirocrew.mock-pid-allocatablealready detects fabricated test PIDs below2**32; this change removes the three reported matches fromtest/test_platform_compat.pywithout claiming a repository-wide sweep.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement