Skip to content

Commit 5e0777e

Browse files
fix: race kernel.shutdown() against timeout to prevent afterAll hook hang in CI
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/3f029c4b-ebf6-4b3d-8bbc-00f3c9cb400e Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 8ea42ee commit 5e0777e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- **MetadataPlugin driver bridging fallback** — Fixed `MetadataPlugin.start()` so the driver service scan fallback (`driver.*`) is reached when ObjectQL returns `null` (not just when it throws). Previously, `setDatabaseDriver` was never called in environments where ObjectQL was not loaded.
3030
- **Auth trustedOrigins test alignment** — Updated `plugin-auth` tests to match the auto-default `http://localhost:*` behavior added in PR #1152 for better-auth CORS support. When no `trustedOrigins` are configured, the implementation correctly defaults to trusting all localhost ports for development convenience.
3131
- **Docs build: lucide-react module resolution** — Added Turbopack `resolveAlias` in `apps/docs/next.config.mjs` so MDX content files in `content/docs/` (outside the app directory) can resolve `lucide-react`. Turbopack starts module resolution from the file's directory, which doesn't have access to the app's `node_modules/`.
32-
- **Client Hono integration test timeout**Increased `beforeAll`/`afterAll` hook timeouts in `client.hono.test.ts` from default 10s to 30s to prevent flaky failures in CI.
32+
- **Client Hono integration test timeout**Fixed `afterAll` hook timeout in `client.hono.test.ts` by racing `kernel.shutdown()` against a 10s deadline. The shutdown can hang when pino's worker-thread flush callback never fires in CI, so the race ensures the hook completes within the 30s vitest limit.
3333
- **CI: Replace `pnpm/action-setup@v6` with corepack** — Switched all GitHub Actions workflows (`ci.yml`, `lint.yml`, `release.yml`, `validate-deps.yml`, `pr-automation.yml`) from `pnpm/action-setup@v6` to `corepack enable` to fix persistent `ERR_PNPM_BROKEN_LOCKFILE` errors. Corepack reads the exact `packageManager` field from `package.json` (including SHA verification), ensuring the correct pnpm version is used in CI. Also bumped pnpm store cache keys to v3 and added a pnpm version verification step.
3434
- **Broken pnpm lockfile** — Regenerated `pnpm-lock.yaml` from scratch to fix `ERR_PNPM_BROKEN_LOCKFILE` ("expected a single document in the stream, but found more") that was causing all CI jobs to fail. The previous merge of PR #1117 only included workflow cache key changes but did not carry over the regenerated lockfile.
3535
- **service-ai: Fix navigation item labels using deprecated i18n object format** — Replaced `{ key, defaultValue }` i18n objects with plain string labels in `AIServicePlugin`'s Setup App navigation contributions, completing the `I18nLabelSchema` migration from [#1054](https://github.com/objectstack-ai/framework/issues/1054).

packages/client/src/client.hono.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,15 @@ describe('ObjectStackClient (with Hono Server)', () => {
110110
}, 30_000);
111111

112112
afterAll(async () => {
113-
if (kernel) await kernel.shutdown();
113+
if (kernel) {
114+
// Race shutdown against a hard deadline.
115+
// kernel.shutdown() can hang when pino's flush callback never fires
116+
// in CI (worker-thread transport timing issues), so cap the wait.
117+
await Promise.race([
118+
kernel.shutdown(),
119+
new Promise<void>((resolve) => setTimeout(resolve, 10_000)),
120+
]);
121+
}
114122
}, 30_000);
115123

116124
it('should connect to hono server and discover endpoints', async () => {

0 commit comments

Comments
 (0)