| 374 | }); |
| 375 | |
| 376 | const cleanup = async () => { |
| 377 | if (exitCode === null) { |
| 378 | proc.kill("SIGTERM"); |
| 379 | await Promise.race([proc.exited, Bun.sleep(3000)]); |
| 380 | if (exitCode === null) proc.kill("SIGKILL"); |
| 381 | } |
| 382 | openapi.server.stop(true); |
| 383 | // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness |
| 384 | await rm(scopeDir, { recursive: true, force: true }).catch(() => {}); |
| 385 | // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness |
| 386 | await rm(dataDir, { recursive: true, force: true }).catch(() => {}); |
| 387 | // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness |
| 388 | await rm(xdgDir, { recursive: true, force: true }).catch(() => {}); |
| 389 | }; |
| 390 | |
| 391 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: standalone smoke harness needs a finally to tear down the spawned binary + http server |
| 392 | try { |