Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop a relay client left running by a server that died #21702

ClosedBirzool(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/21702/headopened View on GitHub

Showing 5 changed files with 72 additions and 0 deletions (loading 3).

x
0 of 5 viewed, 5 left
60 additions and 0 deletionsapps/server/src/cloud/ManagedEndpointRuntime.test.tsModified
View file
@@ -18,6 +18,7 @@
​
import * as ServerSecretStore from "../auth/ServerSecretStore.ts";
import * as ManagedEndpointRuntime from "./ManagedEndpointRuntime.ts";
+import * as RelayClientLedger from "./RelayClientLedger.ts";
​
const layerRelayClientAvailable = Layer.succeed(
RelayClient.RelayClient,
@@ -528,6 +529,65 @@
}),
​
+ it.effect.each([{ ledger: "without" }, { ledger: "with" }])(
+ "starts and stops the connector the same way $ledger a relay client ledger",
+ ({ ledger }) =>
+ Effect.gen(function* () {
+ const events: Array<string> = [];
+ const spawner = ChildProcessSpawner.make(() =>
+ Effect.gen(function* () {
+ const handle = makeHandle({
+ pid: 500,
+ onKill: () => {
+ events.push("kill:500");
+ },
+ });
+ yield* Effect.addFinalizer(() => handle.kill().pipe(Effect.ignore));
+ return handle;
+ }),
+ );