Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve signals in backend exit logs #15406

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/15406/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 43 additions and 8 deletions.

x
0 of 2 viewed, 2 left
24 additions and 0 deletionsapps/desktop/src/backend/DesktopBackendManager.test.tsModified
View file
@@ -431,6 +431,30 @@
}),
​
+ it.effect("reports a SIGKILL exit without an exit code", () =>
+ Effect.gen(function* () {
+ const exitCause = PlatformError.systemError({
+ _tag: "Unknown",
+ module: "ChildProcess",
+ method: "exitCode",
+ cause: new Error("Process interrupted due to receipt of signal: 'SIGKILL'"),
+ });
+ const layerSpawner = Layer.succeed(
+ ChildProcessSpawner.ChildProcessSpawner,
+ ChildProcessSpawner.make(() =>
+ Effect.succeed(makeProcess({ exitCode: Effect.fail(exitCause) })),
+ ),
+ );
+​
+ const exit = yield* DesktopBackendManager.runBackendProcess({
+ ...baseConfig,
+ desktopTelemetryStream: Stream.empty,
+ }).pipe(Effect.scoped, Effect.provide(Layer.merge(layerSpawner, layerHealthyHttpClient)));
+​
+ assert.deepEqual(exit, { code: Option.none(), reason: "killed by SIGKILL" });
+ }),
+ );
+​
it.effect("reports output stream failures with process and stream context", () =>
Effect.gen(function* () {