Repository navigation
test(windows): cover the snapshot refresh-read owner cutoff - #8967
Conversation
Follow-up to #8965: the cap-reached case only exercised the cutoff before each owner read. The new cap-during-owner case moves the cutoff into the past during the first owner read and requires no refresh read.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Maintainer integration (lidge-jun, dev only) at head |
Combine the process-start reserve from lidge-jun#8965 and its lidge-jun#8967 refresh regression with the early snapshot and the enumeration-inclusive owner budget. Check both cutoffs after the refresh before accepting owner evidence. Verified on Windows x64 with Bun 1.4.4: 74 Windows stop tests, two related service tests and 29 layout tests passed. Typecheck covered 2,681 files. The structure check and diff check passed. The full suite was omitted for this scoped conflict resolution during shared Windows validation.
Summary
Follow-up to #8965, covering the gap its review found (P3). #8965 stops owner reads in the Windows process snapshot once the helper reaches the enumeration cap's owner cutoff. It checks that cutoff before each
GetOwnerSidcall and again before the refresh read that follows it. The existingcap-reachedcase only tests the first check: removing the cutoff from the refresh check left every test green.This adds a
cap-during-ownercase to the real-PowerShell owner-enrichment test. The mockedInvoke-CimMethodmoves the cutoff into the past while the first owner read is in flight. The snapshot must keep all 40 rows, make exactly one owner read, and make no refresh read. The case is deterministic, with no sleeps or timing assumptions. Test-only; no runtime change.Verification
bun test tests/windows/windows-process-evidence.test.ts: 13 pass, 3 skip (native-Windows cases), 0 fail.-or [DateTime]::UtcNow -ge $ownerBudget.Untilfrom the refresh check insrc/service/windows-process-evidence.tsfails the new case (budget=cap-during-owner, expected 0 refresh reads, received 1).cap-reachedwith 32 owner reads instead of 0.bun run typecheck,structure:check, the file-size ratchet and test-layout pass.Checklist
Summary by CodeRabbit