diff --git a/server/test/staticPartyService.test.ts b/server/test/staticPartyService.test.ts index 98c1ca8..c2aa116 100644 --- a/server/test/staticPartyService.test.ts +++ b/server/test/staticPartyService.test.ts @@ -195,11 +195,15 @@ describe('StaticPartyStore', () => { const otherFile = path.join(partiesDir(), `${other.id}.json`); const past = new Date(Date.now() - 60000); fs.utimesSync(otherFile, past, past); + // Compared against what the filesystem itself reports back, not + // past.getTime(): Linux returns mtimeMs as a float that can land a + // hair off the exact millisecond set (e.g. ...780.999 for ...781). + const mtimeBefore = fs.statSync(otherFile).mtimeMs; StaticPartyService.markWatched(sp, alice, 'e1'); await StaticPartyStore.writeNow(); - assert.equal(fs.statSync(otherFile).mtimeMs, past.getTime(), 'the untouched party\'s file was not rewritten'); + assert.equal(fs.statSync(otherFile).mtimeMs, mtimeBefore, 'the untouched party\'s file was not rewritten'); }); it('deleting a party removes its file, even with a save still pending', async () => {