diff options
| author | Luke Parker <[email protected]> | 2026-03-07 16:33:12 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-07 16:33:12 +1000 |
| commit | 0b7a5b1e7bc7619c85e7cf4e30a1a0d4885779b6 (patch) | |
| tree | 6fcd11b17e890867a4c8d578452e90ed92fe7ffa /packages/app/e2e/prompt | |
| parent | 28bb16ca2a374439973d4f3f4b71d72f7fdae9cd (diff) | |
| download | opencode-0b7a5b1e7bc7619c85e7cf4e30a1a0d4885779b6.tar.gz opencode-0b7a5b1e7bc7619c85e7cf4e30a1a0d4885779b6.zip | |
test(app): abort sessions and wait for idle before e2e cleanup (#16439)
Diffstat (limited to 'packages/app/e2e/prompt')
| -rw-r--r-- | packages/app/e2e/prompt/prompt-async.spec.ts | 4 | ||||
| -rw-r--r-- | packages/app/e2e/prompt/prompt-shell.spec.ts | 3 | ||||
| -rw-r--r-- | packages/app/e2e/prompt/prompt.spec.ts | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/packages/app/e2e/prompt/prompt-async.spec.ts b/packages/app/e2e/prompt/prompt-async.spec.ts index 10e3fc312..51fbc3e4a 100644 --- a/packages/app/e2e/prompt/prompt-async.spec.ts +++ b/packages/app/e2e/prompt/prompt-async.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from "../fixtures" import { promptSelector } from "../selectors" -import { sessionIDFromUrl, withSession } from "../actions" +import { cleanupSession, sessionIDFromUrl, withSession } from "../actions" const text = (value: string | null) => (value ?? "").replace(/\u200B/g, "").trim() @@ -40,7 +40,7 @@ test("prompt succeeds when sync message endpoint is unreachable", async ({ page, ) .toContain(token) } finally { - await sdk.session.delete({ sessionID }).catch(() => undefined) + await cleanupSession({ sdk, sessionID }) } }) diff --git a/packages/app/e2e/prompt/prompt-shell.spec.ts b/packages/app/e2e/prompt/prompt-shell.spec.ts index c9880bf20..4c92f4a2f 100644 --- a/packages/app/e2e/prompt/prompt-shell.spec.ts +++ b/packages/app/e2e/prompt/prompt-shell.spec.ts @@ -14,7 +14,7 @@ const isBash = (part: unknown): part is ToolPart => { test("shell mode runs a command in the project directory", async ({ page, withProject }) => { test.setTimeout(120_000) - await withProject(async ({ directory, gotoSession }) => { + await withProject(async ({ directory, gotoSession, trackSession }) => { const sdk = createSdk(directory) const prompt = page.locator(promptSelector) const cmd = process.platform === "win32" ? "dir" : "ls" @@ -31,6 +31,7 @@ test("shell mode runs a command in the project directory", async ({ page, withPr const id = sessionIDFromUrl(page.url()) if (!id) throw new Error(`Failed to parse session id from url: ${page.url()}`) + trackSession(id, directory) await expect .poll( diff --git a/packages/app/e2e/prompt/prompt.spec.ts b/packages/app/e2e/prompt/prompt.spec.ts index ff9f5daf0..0466d0988 100644 --- a/packages/app/e2e/prompt/prompt.spec.ts +++ b/packages/app/e2e/prompt/prompt.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from "../fixtures" import { promptSelector } from "../selectors" -import { sessionIDFromUrl, withSession } from "../actions" +import { cleanupSession, sessionIDFromUrl, withSession } from "../actions" test("can send a prompt and receive a reply", async ({ page, sdk, gotoSession }) => { test.setTimeout(120_000) @@ -46,7 +46,7 @@ test("can send a prompt and receive a reply", async ({ page, sdk, gotoSession }) .toContain(token) } finally { page.off("pageerror", onPageError) - await sdk.session.delete({ sessionID }).catch(() => undefined) + await cleanupSession({ sdk, sessionID }) } if (pageErrors.length > 0) { |
