Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): pin clock in saved-usage window test #28603

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/28603/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 1 changed file with 3 additions and 1 deletion.

x
0 of 1 viewed, 1 left
3 additions and 1 deletionapps/server/src/usage/UsageService.test.tsModified
View file
@@ -2640,6 +2640,8 @@
it.live("reports saved usage of a removed directory only for windows it reaches", () =>
Effect.gen(function* () {
const { transcript, settings, home } = yield* setup;
+ // Saved usage is pruned after the retention window, so pin "now" near the write.
+ yield* TestClock.setTime(Date.parse("2026-08-15T00:00:00Z"));
yield* Effect.promise(async () => {
await NodeFSP.writeFile(transcript, claudeLine(1, 5));
const lastWrite = Date.parse("2026-08-01T10:00:00Z") / 1000;
@@ -2665,7 +2667,7 @@
assert.deepStrictEqual(later.buckets, []);
assert.strictEqual(later.sources[0]?.status, "missing");
assert.strictEqual(later.sources[0]?.scannedFiles, 0);
- }).pipe(Effect.scoped),
+ }).pipe(Effect.scoped, Effect.provide(TestClock.layer())),
it.live("does not share an in-flight scan after custom prices change", () =>