A light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.
fix(3726): replace racy 600ms subprocess poll with deterministic test (#3745)
* test(3726): replace racy spawn-poll with deterministic sentinel assertions The original bug-1974 test asserted STATE.md content against a 2000ms wall-clock deadline while the hook's fire-and-forget spawn().unref() subprocess raced to write it — causing intermittent CI failures under Docker contention (#3726). Fix: assert the synchronously-written warnData.criticalRecorded sentinel (readable the moment spawnSync runHook() returns), and invoke `gsd-tools state record-session` synchronously via spawnSync to verify the persistence seam. Adds a counter-test for WARNING-only fires (5 tests total). No production code changed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(3726): repair Windows state add-blocker concurrent-write race acquireStateLock silently returned a false-success lockPath on any non-EEXIST openSync error (the old guard was `if (err.code !== 'EEXIST') return lockPath`). On Windows-24 CI, the releaseStateLock unlink briefly leaves the file in a transitional state so the next O_CREAT|O_EXCL call from a racing process gets EPERM or EBUSY instead of EEXIST. The old guard treated this as "lock not yet created, you own it" and let the second process proceed with its own read-modify-write while the first still held the actual lock — causing one blocker to be silently overwritten. Fix mirrors commits ab24d80b and 47983914 already on main: replace the silent-bypass guard with an explicit ACQUIRE_LOCK_RETRY_ERRNOS allowlist (EPERM, EBUSY, EAGAIN, EINTR, EINVAL, EIO, ENOENT, ESTALE) that retries on transient filesystem conditions, and throw on all other non-EEXIST codes rather than returning a false-success lockPath. The same retry set is applied to withPlanningLock in planning-workspace.cjs (shared root cause, same fix). Local test run: 10/10 pass (locking-bugs-1909-1916-1925-1927.test.cjs). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
T
Tom Boucher committed
75e013191cc2c067de7997a6c191297ac7116f43
Parent: 26773bd
Committed by GitHub <noreply@github.com>
on 5/21/2026, 3:10:32 AM