Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/usage/request-history-rebuild-worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ describe("request-history worker rebuild (#6990)", () => {
writeLedger(ledgerLines(10));
const revision = currentUsageLogRevision()!;
const buildPath = buildFilePath(join(testDir, "unit.sqlite"), process.pid, 1);
expect(() => buildIndexFile(buildPath, "test", { ...revision, ino: revision.ino + 1 }))
// Change the volume, not the file id: an NTFS file id can exceed 2^53, where ino + 1 rounds
// back to the same number and the build sees the recorded file (windows CI, #7070).
expect(() => buildIndexFile(buildPath, "test", { ...revision, dev: revision.dev + 1 }))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve coverage of same-volume ledger replacement

When the ledger is atomically replaced on its existing volume, dev remains unchanged and only ino identifies the replacement. This edit therefore stops the deterministic test from exercising the stat.ino !== expected.ino branch in ingestSourceTail; removing or breaking that check would leave this test green while allowing a worker to index a replaced ledger. Keep the inode mismatch but choose a collision-proof value, such as revision.ino === 0 ? 1 : 0, rather than incrementing the potentially imprecise number.

Useful? React with 👍 / 👎.

.toThrow(RequestHistoryIndexStaleError);
expect(readdirSync(testDir).filter(name => name.startsWith("unit.sqlite"))).toEqual([]);
});
Expand Down
Loading