From c2a9781f655e3e052a8dcc1a57eba6bfe50877b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Almeida?= Date: Sun, 17 May 2026 19:46:32 +0100 Subject: [PATCH] test(e2e): restore the seeded executor's pinned fingerprint after R5 The fingerprint-change-warning spec pinned a deliberately bogus fingerprint on the worker's seeded SSH executor to exercise the mismatch UI, then exited without resetting it. Later specs in the same worker that launched real tasks against the same executor (workdir-per-profile R1/R2 in alphabetical order) failed at SSH dial time with host-key-changed, since the executor was still pinned to the bad value. Wrap the assertion in a try/finally that restores the original fingerprint from seedData when the test ends, so the worker leaves the executor in the same state it inherited. --- apps/web/e2e/tests/ssh/trust-gate.spec.ts | 32 +++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/apps/web/e2e/tests/ssh/trust-gate.spec.ts b/apps/web/e2e/tests/ssh/trust-gate.spec.ts index 225d5ed738..81b732f8cc 100644 --- a/apps/web/e2e/tests/ssh/trust-gate.spec.ts +++ b/apps/web/e2e/tests/ssh/trust-gate.spec.ts @@ -73,7 +73,10 @@ test.describe("ssh trust gate", () => { apiClient, seedData, }) => { - // Set a wrong fingerprint on the seeded executor. + // Set a wrong fingerprint on the seeded executor. Restore it after the + // test so any later spec in the worker that exercises a real launch + // doesn't trip over host-key-changed against the still-bad pin. + const originalFingerprint = seedData.sshTarget.hostFingerprint; await apiClient.updateExecutor(seedData.sshExecutorId, { config: { ssh_host: seedData.sshTarget.host, @@ -85,13 +88,26 @@ test.describe("ssh trust gate", () => { }, }); - const page = new SSHSettingsPage(testPage); - await page.gotoExisting(seedData.sshExecutorId); - await expect(page.pinnedFingerprint()).toHaveText("SHA256:wrong-fingerprint-on-purpose"); + try { + const page = new SSHSettingsPage(testPage); + await page.gotoExisting(seedData.sshExecutorId); + await expect(page.pinnedFingerprint()).toHaveText("SHA256:wrong-fingerprint-on-purpose"); - await page.clickTest(); - await page.waitForTestResult(); - await expect(page.fingerprintChangeWarning()).toBeVisible(); - await expect(page.observedFingerprint()).toHaveText(seedData.sshTarget.hostFingerprint); + await page.clickTest(); + await page.waitForTestResult(); + await expect(page.fingerprintChangeWarning()).toBeVisible(); + await expect(page.observedFingerprint()).toHaveText(seedData.sshTarget.hostFingerprint); + } finally { + await apiClient.updateExecutor(seedData.sshExecutorId, { + config: { + ssh_host: seedData.sshTarget.host, + ssh_port: String(seedData.sshTarget.port), + ssh_user: seedData.sshTarget.user, + ssh_identity_source: "file", + ssh_identity_file: seedData.sshTarget.identityFile, + ssh_host_fingerprint: originalFingerprint, + }, + }); + } }); });