Skip to content

Commit 62998c9

Browse files
MarcoDotIOclaude
andcommitted
test(server): age the abandoned upload with TestClock
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7184d06 commit 62998c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/server/src/cli/pair.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import * as Sink from "effect/Sink";
1818
import * as Stream from "effect/Stream";
1919
import { FetchHttpClient } from "effect/http";
2020
import { ChildProcess, ChildProcessSpawner } from "effect/process";
21+
import * as TestClock from "effect/testing/TestClock";
2122
import * as TestConsole from "effect/testing/TestConsole";
2223
import { Command, CliError } from "effect/cli";
2324

@@ -550,8 +551,7 @@ describe("auth pairing create --base-url", () => {
550551
});
551552

552553
describe("scripted auth output", () => {
553-
// Live clock: the sweep compares the upload's real mtime with the current time.
554-
it.live.each(
554+
it.effect.each(
555555
[
556556
["auth", "session", "issue", "--token-only"],
557557
["auth", "session", "list", "--json"],
@@ -567,6 +567,8 @@ describe("scripted auth output", () => {
567567
NodeFS.writeFileSync(abandoned, "");
568568
const jan2020Seconds = 1_577_836_800;
569569
NodeFS.utimesSync(abandoned, jan2020Seconds, jan2020Seconds);
570+
// The sweep reads Clock, so a week past the upload's mtime makes it expired.
571+
yield* TestClock.setTime((jan2020Seconds + 7 * 24 * 60 * 60) * 1000);
570572

571573
const lines = yield* provideCliTestLayers(
572574
Effect.gen(function* () {

0 commit comments

Comments
 (0)