Skip to content

Commit 21cefe8

Browse files
author
PR Batch Tester
committed
test(desktop): check the full readiness grace period
1 parent 205ab1c commit 21cefe8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/desktop/src/backend/DesktopBackendManager.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,6 @@ describe("DesktopBackendManager", () => {
651651
...(onReady ? { onReady } : {}),
652652
}).pipe(Effect.tap((instance) => instance.start));
653653

654-
// A large state database took about 66 s to migrate and start listening.
655654
const slowStatus = yield* Ref.make(503);
656655
const ready = yield* Deferred.make<void>();
657656
yield* startInstance(slowStatus, Deferred.succeed(ready, undefined).pipe(Effect.asVoid));
@@ -662,7 +661,9 @@ describe("DesktopBackendManager", () => {
662661
assert.isTrue(Option.isNone(yield* Queue.poll(reports)));
663662

664663
yield* startInstance(yield* Ref.make(503));
665-
yield* TestClock.adjust(Duration.minutes(3));
664+
yield* TestClock.adjust(Duration.seconds(179));
665+
assert.isTrue(Option.isNone(yield* Queue.poll(reports)));
666+
yield* TestClock.adjust(Duration.seconds(1));
666667
const failure = yield* Queue.take(reports);
667668
assert.equal(failure.reason, "The server started but did not become ready in time.");
668669
}).pipe(Effect.provide(TestClock.layer())),

‎apps/desktop/src/backend/DesktopBackendManager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import * as DesktopWslEnvironment from "../wsl/DesktopWslEnvironment.ts";
3434
const INITIAL_RESTART_DELAY = Duration.millis(500);
3535
const MAX_RESTART_DELAY = Duration.seconds(10);
3636
const MAX_PREFLIGHT_FAILURE_ATTEMPTS = 5;
37-
// Migrations on a 22 GB state database take over a minute; a timeout opens the recovery window.
37+
// Large state databases can take over a minute to become ready.
3838
const DEFAULT_BACKEND_READINESS_TIMEOUT = Duration.minutes(3);
3939
const DEFAULT_BACKEND_READINESS_INTERVAL = Duration.millis(100);
4040
const DEFAULT_BACKEND_READINESS_REQUEST_TIMEOUT = Duration.seconds(1);

0 commit comments

Comments
 (0)