Skip to content

Commit f290a36

Browse files
committed
test(timeline): assert the injected file sync ran in the refused-flush case
The EPERM case proves the refusal is tolerated by checking that the next flush rewrites nothing, and that check reads `synced`, which only grows when the injected file sync is called. With the seam gone it stayed 0, so `assert.equal(synced.length, written)` compared `0 === 0` and the case could not tell that its injection never happened — deleting the seam left it green and only the two controls failed (FlyBot Test found this while mutating the tip). The case now asserts the file sync ran at least once, so a missing seam fails it directly. Docs-not-needed: tests only; no product behaviour and no documented write order changes. Fixes #3301
1 parent daa1837 commit f290a36

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎plugins/timeline/test/store.test.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ test('a directory fsync the platform refuses still saves the segment (Windows EP
300300
assert.equal(trace.flush(), true, 'the bytes are durable once the file was synced and renamed')
301301
assert.equal(trace.stats().failing, false, 'a refused directory sync is not a failed write')
302302
const written = synced.length
303+
assert.ok(synced.length >= 1, 'the injected file sync ran')
303304
assert.equal(trace.flush(), true, 'a flush with nothing new succeeds too')
304305
assert.equal(synced.length, written, 'a saved segment is not rewritten by the next flush')
305306
trace.close()

0 commit comments

Comments
 (0)