test(perf): dedupe fixtures and reduce flaky waits

This commit is contained in:
Peter Steinberger
2026-02-22 22:05:49 +00:00
parent b534dfa3e0
commit 7b229decdd
13 changed files with 249 additions and 239 deletions

View File

@@ -105,7 +105,8 @@ describe("rotateSessionFile", () => {
let now = Date.now();
const nowSpy = vi.spyOn(Date, "now").mockImplementation(() => (now += 5));
try {
for (let i = 0; i < 5; i++) {
// 4 rotations are enough to verify pruning to <=3 backups.
for (let i = 0; i < 4; i++) {
await fs.writeFile(storePath, `data-${i}-${"x".repeat(100)}`, "utf-8");
await rotateSessionFile(storePath, 50);
}