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.
This commit is contained in:
Brennan Benson
2026-08-28 08:02:58 -07:00
parent 40ce87bb2c
commit 0a5d79aeee
@@ -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', () => {