diff --git a/tests/runner-e2e/remote-native-bootstrap.test.ts b/tests/runner-e2e/remote-native-bootstrap.test.ts index 915d1ccdac..c3d68c4127 100644 --- a/tests/runner-e2e/remote-native-bootstrap.test.ts +++ b/tests/runner-e2e/remote-native-bootstrap.test.ts @@ -308,6 +308,8 @@ it.each([ ["Playwright fetch timeout", new Error("apiRequestContext.get: Timeout 1000ms exceeded. PRIVATE"), "transient_infrastructure"], ["server fetch timeout", new Error("Timeout 1000ms exceeded PRIVATE"), "transient_infrastructure"], ["connection reset", new Error("apiRequestContext.get: read ECONNRESET PRIVATE"), "transient_infrastructure"], + ["socket hang up", new Error("socket hang up"), "transient_infrastructure"], + ["prefixed socket hang up", new Error("apiRequestContext.get: Socket Hang Up PRIVATE"), "transient_infrastructure"], ["undefined", undefined, "candidate_failure"], ["null", null, "candidate_failure"], ["private string", "PRIVATE 503 TimeoutError", "candidate_failure"], @@ -335,7 +337,7 @@ it.each([[503, "transient_infrastructure"], [403, "permanent_infrastructure"], [ vi.stubEnv("PAPERCLIP_RUNNER_E2E_PORT", "3100"); const h = harness(43_000); h.bootstrap.prompt("actual-api"); const original = h.api.get.getMockImplementation()!; - const secret = "PRIVATE body: forbidden secret plaintext 503 timeout ".repeat(10_000); + const secret = "PRIVATE body: forbidden secret plaintext 503 timeout socket hang up ".repeat(10_000); const request = { get: vi.fn(async (path: string) => ({ ok: () => !path.endsWith("/leases"), status: () => status, url: () => "http://PRIVATE.invalid/private", text: async () => secret, diff --git a/tests/runner-e2e/remote-native-bootstrap.ts b/tests/runner-e2e/remote-native-bootstrap.ts index 0f90b4b693..af6dfcc593 100644 --- a/tests/runner-e2e/remote-native-bootstrap.ts +++ b/tests/runner-e2e/remote-native-bootstrap.ts @@ -20,7 +20,7 @@ function admissionReadError(endpoint: AdmissionEndpoint, error: unknown): Remote } else if (error instanceof Error) { const message = error.message.slice(0, 256); if (error.name === "TimeoutError" || /^(?:apiRequestContext\.get: )?Timeout \d+ms exceeded\b/u.test(message) - || /\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|ENOTFOUND|EAI_AGAIN)\b/u.test(message)) failureClass = "transient_infrastructure"; + || /\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|socket hang up)\b/iu.test(message)) failureClass = "transient_infrastructure"; } } catch { /* Unknown rejection values remain a bounded candidate failure. */ } return new RemoteAdmissionReadError(endpoint, failureClass);