From f37ab7eac7dd9c6f032f7c220bb4f523d061f97e Mon Sep 17 00:00:00 2001 From: haelyra <49814733+haelyra@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:39:33 -0500 Subject: [PATCH] test: backdate held log lock without an existence race --- tests/scripts/post-bash-command-log-concurrency.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/post-bash-command-log-concurrency.test.js b/tests/scripts/post-bash-command-log-concurrency.test.js index 6c8d46ae7..ec327446a 100644 --- a/tests/scripts/post-bash-command-log-concurrency.test.js +++ b/tests/scripts/post-bash-command-log-concurrency.test.js @@ -87,7 +87,8 @@ test('a terminated rotating writer does not strand subsequent logging', () => fi test('contention stays bounded and records the command without racing a rotation', () => fixture(async (root, file, children) => { const owner = start(root, 'owner', children); await waitFor(root, ['owner-rotate-ready']); - if (fs.existsSync(`${file}.lock`)) fs.utimesSync(`${file}.lock`, new Date(0), new Date(0)); + try { fs.utimesSync(`${file}.lock`, new Date(0), new Date(0)); } + catch (error) { if (error.code !== 'ENOENT') throw error; } await finished(start(root, 'busy', children)); assert.equal(fs.existsSync(`${file}.1`), false, 'the waiting writer must not rotate outside the lock'); signal(root, 'owner-release');