test(server): initialize issue routes within the fixture hook

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-12 19:51:30 -05:00
1 parent 0d998fad49
commit 42e5d9bae4
2 files changed
+29 -4

No files matched your search

@@ -649,3 +649,20 @@ integration hold. The independent serialized issue-route timeout remains under
phase diagnosis; a subsequent full mocked suite passes 36 controls but does not
waive the cloud failure or prove its latency cause. Final source composition,
required CI and the provider-free cloud packaging campaign remain pending.
## Serialized route fixture initialization — 2026-10-12
The failing inherited-pause cloud case timed out at its 15000 ms outer test bound.
Temporary local phase instrumentation measured cold route imports at 9741 ms
(and 11920 ms in a separate diagnostic attempt), followed by a POST 409 response
in 11 ms and PATCH 409 in 4 ms. The subsequent full mocked suite passed 36 cases;
these measurements do not establish the exact unrecorded cloud latency. Route
module loading now runs in beforeEach after the same per-case module reset,
unmocking and mock initialization. It uses the existing 30000 ms setup-hook bound;
the 15000 ms request/test bound, application construction, policy assertions and
mutation/wakeup checks are unchanged. All 36 treatment controls pass. Temporary
phase instrumentation was removed. Evidence:
`/private/tmp/claude-pause-route-phases.txt`,
`/private/tmp/claude-pause-route-targeted-phases.log`, and
`/private/tmp/claude-pause-route-hook-controls.log`. Exact-head cloud verification
is still required; no timeout is waived and no provider or native build was run.
@@ -205,12 +205,17 @@ function registerModuleMocks() {
}));
}
async function createApp(transaction: (callback: (tx: Record<string, never>) => Promise<unknown>) => Promise<unknown> =
async (callback) => callback({})) {
const [{ errorHandler }, { issueRoutes }] = await Promise.all([
function loadRouteFixture() {
return Promise.all([
vi.importActual<typeof import("../middleware/index.js")>("../middleware/index.js"),
vi.importActual<typeof import("../routes/issues.js")>("../routes/issues.js"),
]);
}
let routeFixture: Awaited<ReturnType<typeof loadRouteFixture>>;
async function createApp(transaction: (callback: (tx: Record<string, never>) => Promise<unknown>) => Promise<unknown> =
async (callback) => callback({})) {
const [{ errorHandler }, { issueRoutes }] = routeFixture;
const app = express();
app.use(express.json());
app.use((req, _res, next) => {
@@ -253,7 +258,7 @@ function makeIssue(overrides: Record<string, unknown> = {}) {
}
describe("issue update comment wakeups", () => {
beforeEach(() => {
beforeEach(async () => {
vi.resetModules();
vi.doUnmock("../routes/issues.js");
vi.doUnmock("../routes/authz.js");
@@ -271,6 +276,9 @@ describe("issue update comment wakeups", () => {
mockIssueService.getWakeableParentAfterChildCompletion.mockResolvedValue(null);
mockIssueService.getCurrentScheduledRetry.mockResolvedValue(null);
mockIssueService.listReviewAttention.mockResolvedValue(new Map());
// A fresh route graph is fixture preparation, not request execution. Keep
// per-case module resets while charging the cold transform to hookTimeout.
routeFixture = await loadRouteFixture();
});
it.each(["post", "patch"] as const)("rejects %s board messages under an inherited pause before any mutation", async (method) => {