Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(ssh): report remote stop failures without losing ownership #10105

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/10105/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 124 additions and 1 deletion (loading 2).

x
0 of 3 viewed, 3 left
124 additions and 1 deletionpackages/ssh/src/runnerProcess.test.tsModified
View file
@@ -11,7 +11,7 @@
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import * as NodeNet from "node:net";
​
-import { buildRemoteT3RunnerScript } from "./tunnel.ts";
+import { buildRemoteStopScript, buildRemoteT3RunnerScript } from "./tunnel.ts";
​
const Started = Schema.Struct({
pid: Schema.Number,
@@ -166,6 +166,129 @@
​
+describe.skipIf(HostProcessPlatform.defaultValue() === "win32")(
+ "remote stop process ownership",
+ () => {
+ it.live.each(["graceful", "timeout", "external"] as const)(
+ "confirms the stop result for a %s server",
+ (mode) =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
+ const fixture = yield* fs.makeTempDirectoryScoped({ prefix: "t3-stop-" });
+ const signalPath = path.join(fixture, "signals");
+ const child = yield* spawner.spawn(
+ ChildProcess.make(
+ process.execPath,
+ [