Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client): stop blaming DNS when only the T3 Connect WebSocket fails #14508

ClosedGigioxx(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/14508/headopened View on GitHub

Showing 5 changed files with 31 additions and 6 deletions (loading 2).

x
0 of 5 viewed, 5 left
17 additions and 1 deletionpackages/client-runtime/src/connection/supervisor.test.tsModified
View file
@@ -39,7 +39,7 @@
import * as RpcSession from "../rpc/session.ts";
import * as EnvironmentSupervisor from "./supervisor.ts";
import * as ConnectionWakeups from "./wakeups.ts";
-import { NETWORK_BLOCKING_HINT } from "../errors/network.ts";
+import { NETWORK_BLOCKING_HINT, WEBSOCKET_BLOCKING_HINT } from "../errors/network.ts";
​
const TARGET = new PrimaryConnectionTarget({
environmentId: EnvironmentId.make("environment-1"),
@@ -479,6 +479,22 @@
}).pipe(Effect.provide(TestClock.layer())),
​
+ it.effect("blames the WebSocket when a relay connection stalls after preparing", () =>
+ Effect.gen(function* () {
+ const harness = yield* makeHarness({ ready: () => Effect.never });
+ const supervisor = yield* EnvironmentSupervisor.make(RELAY_ENTRY, {
+ initiallyDesired: true,
+ }).pipe(Effect.provide(harness.dependencies));
+​
+ yield* awaitState(supervisor.state, (state) => state.stage === "synchronizing");
+ yield* TestClock.adjust("15 seconds");
+ const failed = yield* awaitState(supervisor.state, (state) => state.phase === "backoff");
+ expect(failed.lastFailure?.message).toBe(
+ `Test environment did not finish connection setup after T3 Connect accepted the request. ${WEBSOCKET_BLOCKING_HINT}`,
+ );
+ }).pipe(Effect.provide(TestClock.layer())),
+ );
+​