From f6727d3e99e9388b19c5c2306ddd0df6ae694e06 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 10:38:12 +0000 Subject: [PATCH 1/2] fix(app-showcase): shut down kernels before disconnecting drivers in approval-resume-relation-expand.test.ts The afterEach in this test disconnected the drivers before shutting down the kernels, so every kernel's own teardown ran against a driver that was already gone. Swap the order: stop the producers, then remove the resource they depend on. packages/services/service-messaging/src/plugin-shutdown-stops-dispatchers.test.ts (#9371) already does it in the right order; the comment explaining why is carried across verbatim. Measured (not assumed): on current main this file's own DATABASE_ERROR console lines are all "no such table" probes against sys_organization/ sys_user/sys_member/sys_user_position/sys_user_permission_set/sys_position (tables this harness's bootShowcaseApprovals() never provisions) -- not post-disconnect reads. Before/after/ablation-restore all measure identically (31 DATABASE_ERROR lines in isolated runs, 36 in the full 24-file suite, byte-for-byte identical breakdown each time), so the reordering is a no-op for this file's console volume today. The fix still stands on the ordering principle itself, not on savings: draining a kernel against an already-disconnected driver is the wrong order regardless. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0f14f70b-575c-5f2b-a235-4000a55db042 --- .../test/approval-resume-relation-expand.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/app-showcase/test/approval-resume-relation-expand.test.ts b/examples/app-showcase/test/approval-resume-relation-expand.test.ts index a9fd1ae5c5..c872f57b96 100644 --- a/examples/app-showcase/test/approval-resume-relation-expand.test.ts +++ b/examples/app-showcase/test/approval-resume-relation-expand.test.ts @@ -68,12 +68,15 @@ const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)); const openKernels: Array<{ shutdown?: () => Promise }> = []; const openDrivers: Array<{ disconnect?: () => Promise }> = []; afterEach(async () => { - while (openDrivers.length) { - try { await openDrivers.pop()?.disconnect?.(); } catch { /* noop */ } - } + // Kernels first, drivers second: the kernel's own teardown still wants a + // live driver to drain against. (Reversing these is what makes a suite + // shout DATABASE_ERROR at teardown time.) while (openKernels.length) { try { await openKernels.pop()?.shutdown?.(); } catch { /* noop */ } } + while (openDrivers.length) { + try { await openDrivers.pop()?.disconnect?.(); } catch { /* noop */ } + } }); interface Booted { From bb80eac245f8105ccc68e8bd866766a7a7eeb25d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 11:05:26 +0000 Subject: [PATCH 2/2] fix(app-showcase): correct the teardown comment to match the measurement The comment landed in the previous commit asserted that reversing the kernel/driver teardown order is what makes this file's DATABASE_ERROR lines appear -- but the PR's own before/after measurement shows the opposite: those lines are "no such table" probes bootShowcaseApprovals() never provisions, unaffected by the swap (36/31, identical before and after). Restate the comment as two separate claims: the ordering rule (why the change is correct regardless of today's cost) and the measured fact about this file's own DATABASE_ERROR lines (why the swap didn't move them). Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx --- .../test/approval-resume-relation-expand.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/app-showcase/test/approval-resume-relation-expand.test.ts b/examples/app-showcase/test/approval-resume-relation-expand.test.ts index c872f57b96..c7ffa61578 100644 --- a/examples/app-showcase/test/approval-resume-relation-expand.test.ts +++ b/examples/app-showcase/test/approval-resume-relation-expand.test.ts @@ -69,8 +69,13 @@ const openKernels: Array<{ shutdown?: () => Promise }> = []; const openDrivers: Array<{ disconnect?: () => Promise }> = []; afterEach(async () => { // Kernels first, drivers second: the kernel's own teardown still wants a - // live driver to drain against. (Reversing these is what makes a suite - // shout DATABASE_ERROR at teardown time.) + // live driver to drain against -- that is the rule, regardless of what it + // costs on any given day. + // + // Measured here (#10373): this file's own DATABASE_ERROR lines are all + // "no such table" probes against sys_* tables bootShowcaseApprovals() + // never provisions, not post-disconnect reads -- swapping the order left + // the count unchanged (36 suite-wide / 31 in this file, before and after). while (openKernels.length) { try { await openKernels.pop()?.shutdown?.(); } catch { /* noop */ } }