Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): keep probing backend readiness while the process is alive #5526

Mergedlgwacker(GitHub profile, opens in a new tab)merged 23 commits intomain fromrefs/pull/5526/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 103 additions and 12 deletions.

x
0 of 2 viewed, 2 left
78 additions and 0 deletionsapps/desktop/src/backend/DesktopBackendManager.test.tsModified
View file
@@ -701,6 +701,84 @@
​
+ it.effect(
+ "re-probes readiness after the first budget expires while the backend is still alive",
+ () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const requestUrls: Array<string> = [];
+ let requestCount = 0;
+ let readyCount = 0;
+ let readinessTimeoutCount = 0;
+ const firstProbe = yield* Deferred.make<void>();
+ const childExit = yield* Deferred.make<void>();
+​
+ const spawnerLayer = Layer.succeed(
+ ChildProcessSpawner.ChildProcessSpawner,
+ ChildProcessSpawner.make(() =>
+ Effect.succeed(
+ makeProcess({
+ exitCode: Deferred.await(childExit).pipe(
+ Effect.as(ChildProcessSpawner.ExitCode(0)),
+ ),
+ }),
+ ),
+ ),
+ );
+​
+ // The backend stays 503 through the first *two* readiness budgets