From 0a5d79aeeec2761a427ff8de0f4ee291e37c4030 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 28 Aug 2026 06:38:06 -0700 Subject: [PATCH] test(daemon): pin that an ownership conflict does not emit the degrade warning The EEXIST rethrow sits above the non-atomic degrade warning precisely so a lost publish race stays quiet, but nothing pinned that order: moving the warn above the rethrow left all seven atomicity tests green. Assert the conflict path warns zero times so the two arms fail independently. --- src/main/daemon/daemon-pid-publish-atomicity.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/daemon/daemon-pid-publish-atomicity.test.ts b/src/main/daemon/daemon-pid-publish-atomicity.test.ts index 207a4d0e8f7..774ffcc9d13 100644 --- a/src/main/daemon/daemon-pid-publish-atomicity.test.ts +++ b/src/main/daemon/daemon-pid-publish-atomicity.test.ts @@ -130,6 +130,9 @@ describe('publishDaemonPidFile atomicity', () => { expect(() => publishDaemonPidFile(pidPath, RECORD)).toThrow(/EEXIST/) expect(readFileSync(pidPath, 'utf8')).toBe(existing) expect(listPublishScratch()).toEqual([]) + // An ownership conflict is routine, not a degrade: warning here would make the + // real non-atomic warning below indistinguishable from a lost publish race. + expect(warnSpy).not.toHaveBeenCalled() }) it('degrades to the exclusive direct write when the filesystem cannot hard-link', () => {