Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): give the SSH readiness probe room for high-RTT links #7815

ClosedExotic209093(GitHub profile, opens in a new tab)wants to merge 11 commits intomain fromrefs/pull/7815/headopened View on GitHub

Showing 2 changed files with 74 additions and 1 deletion.

x
0 of 2 viewed, 2 left
65 additions and 0 deletionspackages/ssh/src/tunnel.test.tsModified
View file
@@ -518,6 +518,71 @@
}),
​
+ it.effect.each(["initial connection", "reuse"] as const)(
+ "accepts a slow healthy HTTP response on tunnel %s",
+ (phase) =>
+ Effect.gen(function* () {
+ const probeStarted = yield* Deferred.make<void>();
+ const respond = yield* Deferred.make<void>();
+ let slow = phase === "initial connection";
+ let interruptedProbes = 0;
+ let forwards = 0;
+ let kills = 0;
+ const spawner = ChildProcessSpawner.make((command) =>
+ Effect.sync(() => {
+ if (!commandArgs(command).includes("-N")) {
+ return makeSuccessfulProcess('{"remotePort":3773}\n');
+ }
+ forwards += 1;
+ return makeRunningProcess(() => {
+ kills += 1;
+ });
+ }),
+ );
+ const httpClient = HttpClient.make((request) =>
+ Effect.gen(function* () {
+ if (slow) {
+ yield* Deferred.succeed(probeStarted, undefined);
+ yield* Deferred.await(respond).pipe(