From afdf403ae9e3f07b5a9bc1360c3b37ad9dfc295e Mon Sep 17 00:00:00 2001 From: haelyra <49814733+haelyra@users.noreply.github.com> Date: Sun, 11 Oct 2026 03:54:38 -0400 Subject: [PATCH] test: keep stale lock race fixture portable --- tests/docs/story-lifecycle-ledger.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docs/story-lifecycle-ledger.test.js b/tests/docs/story-lifecycle-ledger.test.js index 4f97eabd7..f96bafb88 100644 --- a/tests/docs/story-lifecycle-ledger.test.js +++ b/tests/docs/story-lifecycle-ledger.test.js @@ -320,7 +320,7 @@ const tests = [ const preload = path.join(root, 'race.js'); fs.writeFileSync(preload, `const fs = require('fs'); const orig = fs.openSync; let raced = false; fs.openSync = function (p, ...a) { const r = orig.call(fs, p, ...a); - if (!raced && String(p).endsWith('.lock') && a[0] === fs.constants.O_NOFOLLOW) { raced = true; fs.unlinkSync(p); + if (!raced && String(p).endsWith('.lock') && a[0] === (fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0))) { raced = true; fs.unlinkSync(p); fs.writeFileSync(p, JSON.stringify({ pid: ${process.pid}, host: require('os').hostname(), at: 'live' }), { flag: 'wx' }); } return r; };`); const r = spawnSync(process.execPath, ['-r', preload, LEDGER, 'allocate', '--epic', 'auth-flow', '--root', root, '--wait-ms', '200'], { encoding: 'utf8' });