summaryrefslogtreecommitdiffhomepage
path: root/packages/app
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app')
-rw-r--r--packages/app/e2e/backend.ts10
-rw-r--r--packages/app/package.json2
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/app/e2e/backend.ts b/packages/app/e2e/backend.ts
index 9febc4b3f..a03d1d437 100644
--- a/packages/app/e2e/backend.ts
+++ b/packages/app/e2e/backend.ts
@@ -44,8 +44,12 @@ async function waitForHealth(url: string, probe = "/global/health") {
throw new Error(`Timed out waiting for backend health at ${url}${probe}${last ? ` (${last})` : ""}`)
}
+function done(proc: ReturnType<typeof spawn>) {
+ return proc.exitCode !== null || proc.signalCode !== null
+}
+
async function waitExit(proc: ReturnType<typeof spawn>, timeout = 10_000) {
- if (proc.exitCode !== null) return
+ if (done(proc)) return
await Promise.race([
new Promise<void>((resolve) => proc.once("exit", () => resolve())),
new Promise<void>((resolve) => setTimeout(resolve, timeout)),
@@ -123,11 +127,11 @@ export async function startBackend(label: string, input?: { llmUrl?: string }):
return {
url,
async stop() {
- if (proc.exitCode === null) {
+ if (!done(proc)) {
proc.kill("SIGTERM")
await waitExit(proc)
}
- if (proc.exitCode === null) {
+ if (!done(proc)) {
proc.kill("SIGKILL")
await waitExit(proc)
}
diff --git a/packages/app/package.json b/packages/app/package.json
index 3e12c492b..2ac271df2 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/app",
- "version": "1.4.2",
+ "version": "1.4.3",
"description": "",
"type": "module",
"exports": {