Repository navigation
test: report Windows ACL fixture phase timings - #190
Conversation
abogartz
left a comment
There was a problem hiding this comment.
Review: APPROVED_WITH_NITS
Reviewed at 7bf5dda. Test-only, one file, and the instrumentation does exactly what it says without touching what the fixture is actually asserting.
Verified
- The assertions are untouched. The ACL fixture contains 4
expect(calls before and after:ran === false,failed === true, the sub-2-second bound, and/EPERM|EACCES|permission/i. The{ timeoutMs: 5000 }argument and the30_000outer budget are both still there (test/lock.test.ts:293, previously:261). - The timing change is a tightening, not a loosening.
Date.now() - t0is now captured in thefinally(lockMs = Date.now() - t0; endLock();) and asserted afterwards, so the diagnostic write is excluded from the measured interval rather than included in it — the claim in your body is accurate in the direction that matters. - Nothing leaks. Every new line is
JSON.stringifyof{phase, event, elapsedMs, exitCode?}plus two fixednot-exercisedreason strings. No username, no temp path, noicaclsargv. Confirmed against the real hosted output rather than the code: the Windows job emitted exactly the five pairs —identity 37ms exitCode 0,acl-deny 16ms exitCode 0,deny-probe 0ms,lock 90ms,acl-restore 15ms. measure()cannot swallow a failure: the value is returned from insidetryand thefinallyonly logs, so thewriteFileSyncthrow that the fixture depends on fordenied = truestill propagates.- Gates: locally (macOS)
test/lock.test.tsis 9 pass / 1 skip (thewin32block, as expected), typecheck clean, biome 409 warnings — flat versus base. CI: lint / test / test-windows / smoke all green at this head.
Nits
not-exercisedstill counts as a pass. Logging the two capability bail-outs is a real improvement over a barereturn— but the run still reports green while the defence was never exercised, which is the exact accounting gap #71 complains about ("capability probes can return early and print as passed"). Cheap close: have the sweep/triage tooling treat a[acl-fixture] {"event":"not-exercised"}line as a declared skip so the ledger's denominator is not inflated on runners that cannot manage ACLs.- Setup is outside the instrumentation.
tmp()andmkdirSync(store)run before the firstmeasure("identity", …), so a stall there would show every phase fast and still blow the 30 s budget — the one failure mode this PR exists to diagnose. Worth wrapping in aphase: "setup"for symmetry. - Minor shape point: the
deny-probeend line has noexitCodekey at all (the wrapped call returnsvoid). A uniformexitCode: nullwould make the emitted lines trivially parseable as one record type.
Neither nit has to land before this merges — the instrumentation is already earning its keep on the hosted runner, and the historical stall is still unexplained, which you say plainly.
|
Addressed the local instrumentation nits in
Windows / Bun 1.4.4: all 10 lock tests pass, including real ACL denial (no capability bailout); six phase pairs were emitted. Typecheck and lint pass, with the same 409 advisory warnings. I did not rerun the full gate for this test-diagnostics-only follow-up; CI will exercise the pushed head. I recorded the Please feel free to defer the accounting follow-up or decline the extra diagnostics if they are not useful to the project. |
abogartz
left a comment
There was a problem hiding this comment.
Round 2: APPROVED
Re-verified at 1a4e1b5. One file touched, both test-side nits closed, and — the part I can only check on the hosted runner — the new telemetry actually fires where it is supposed to.
Hosted Windows log at this head (ci run 41161137856, test-windows success), the complete [acl-fixture] stream:
setup end 1 ms exitCode: null
identity end 31 ms exitCode: 0
acl-deny end 11 ms exitCode: 0
deny-probe end 0 ms exitCode: null
lock end 91 ms exitCode: null
acl-restore end 11 ms exitCode: 0
setup is now inside the instrumentation, so tmp() + mkdirSync can no longer stall and report every phase fast before blowing the 30 s budget — the specific blind spot this PR exists to diagnose, which was the one asymmetry left in round 1. And the record shape is uniform: deny-probe and lock now carry "exitCode": null rather than omitting the key, so every line parses as one record type instead of needing a conditional reader. No not-exercised line, which is the good case — the ACL defence really was exercised on that runner.
Nothing weakened: expect( count in test/lock.test.ts is 24 at both 7bf5dda and 1a4e1b5; the diff is the exitCode expression plus wrapping four lines in measure("setup", …). timeoutMs: 5000 and the outer 30_000 budget are untouched. Local gates: typecheck clean, biome exit 0 at 409 warnings — flat versus base, unit 722 pass / 12 skip / 0 fail (the Windows suite is skipIf on darwin; the hosted run is the only place it lives, and it is green).
Still open from my list, and it is a sweep-tooling item rather than one in this diff: a [acl-fixture] {"event":"not-exercised"} line still prints as a pass, so a runner that cannot manage ACLs inflates the ledger's denominator by one — the same accounting gap #71 is about. Nothing here regressed it; the two bail-outs are now at least logged rather than a silent return.
The historical stall this PR hunts is still unexplained, which the body says plainly. What this adds is that a stall in setup is no longer invisible when it recurs.
|
🎉 This PR is included in version 0.14.28 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The Windows ACL fixture previously exhausted its outer timeout without showing whether identity lookup, ACL setup, the lock probe, or cleanup was slow. Emit start/end records and elapsed milliseconds for those phases, including command exit codes and explicit notices when the fixture cannot exercise ACL denial. No usernames or paths are logged.
The production lock behavior, 30-second outer budget, and all four assertions remain intact. The lock must still fail in under two seconds; its measured interval excludes diagnostic output.
Validation on Windows with Bun 1.4.4: ten focused repetitions passed (40 assertions), with phase records present. The full merge gate passed (typecheck, lint, 722 unit passes/12 skips, and 11 e2e passes). These local runs do not establish which phase caused the historical timeout; hosted-runner timing is the purpose of this instrumentation.
Refs #68, particularly the follow-up in #68 (comment). This does not close the broader issue.
Please feel free to decline or close this if the extra test logging is not useful for your project.
Hosted validation: all four checks passed at
7bf5dda. The Windows job exercised the ACL fixture and emitted all five phase pairs: identity 37 ms, ACL deny 16 ms, deny probe 0 ms, lock 90 ms, restoration 15 ms (fixture total 161.51 ms). This successful run establishes that the diagnostics work on the hosted runner; it does not explain the historical stall. Windows job.