Skip to content

Commit 1280ccd

Browse files
t3dotggclaude
andauthored
test(server): pin clock in saved-usage window test (#28603)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 460b88b commit 1280ccd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/server/src/usage/UsageService.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2640,6 +2640,8 @@ describe("UsageService", () => {
26402640
it.live("reports saved usage of a removed directory only for windows it reaches", () =>
26412641
Effect.gen(function* () {
26422642
const { transcript, settings, home } = yield* setup;
2643+
// Saved usage is pruned after the retention window, so pin "now" near the write.
2644+
yield* TestClock.setTime(Date.parse("2026-08-15T00:00:00Z"));
26432645
yield* Effect.promise(async () => {
26442646
await NodeFSP.writeFile(transcript, claudeLine(1, 5));
26452647
const lastWrite = Date.parse("2026-08-01T10:00:00Z") / 1000;
@@ -2665,7 +2667,7 @@ describe("UsageService", () => {
26652667
assert.deepStrictEqual(later.buckets, []);
26662668
assert.strictEqual(later.sources[0]?.status, "missing");
26672669
assert.strictEqual(later.sources[0]?.scannedFiles, 0);
2668-
}).pipe(Effect.scoped),
2670+
}).pipe(Effect.scoped, Effect.provide(TestClock.layer())),
26692671
);
26702672

26712673
it.live("does not share an in-flight scan after custom prices change", () =>

0 commit comments

Comments
 (0)