fix(#474): deterministic STATE dates via deepened clock seam (nowIso/today + GSD_NOW_MS adapter) (#477)
* fix(#474): route state date-stamping + installer lock loop through clock seam (nowIso/today + GSD_NOW_MS adapter) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(#474): use process.ppid (not pid 1) as held-lock owner in install-lock timeout test pid 1 is POSIX init/launchd (always alive) but does not exist on Windows, so isPidAlive(1) returns false, the lock is reclaimed as stale, and acquireInstallMigrationLock no longer throws -- failing the timeout assertion on windows-latest,22. process.ppid is a live, non-self process on every platform, so the lock is seen as held and the timeout path throws deterministically cross-platform. Refs #474 --------- Co-authored-by: CI Rebase Check <ci@gsd-redux> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,26 @@ function makeFakeClock(startMs) {
|
||||
_now += ms;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the virtual instant as an ISO 8601 string (UTC).
|
||||
* Mirrors realClock.nowIso() so fake clocks are drop-in substitutes.
|
||||
*
|
||||
* @returns {string} e.g. "2020-06-15T12:00:00.000Z"
|
||||
*/
|
||||
nowIso() {
|
||||
return new Date(_now).toISOString();
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the virtual date as a YYYY-MM-DD string (UTC calendar day).
|
||||
* Mirrors realClock.today() so fake clocks are drop-in substitutes.
|
||||
*
|
||||
* @returns {string} e.g. "2020-06-15"
|
||||
*/
|
||||
today() {
|
||||
return new Date(_now).toISOString().split('T')[0];
|
||||
},
|
||||
|
||||
/** Array of ms values passed to sleep() in call order. */
|
||||
get sleepCalls() {
|
||||
return _sleepCalls;
|
||||
|
||||
Reference in New Issue
Block a user