commit c01f9886b2c9f00e90d7f409a79e189b9c82c110
parent fc870c7f5f63e9f04a1516ef6bc2b505b675afed
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 11 Nov 2026 02:58:34 -0500
umtool e2e: the recurring-report specs wait for each schedule write's answer before reading the page -- Plan, Pause and Resume each run the editor stub's real report-schedule action in a tsx child (spawnSync, 3.4 s on an idle machine, measured), so an expect's 5 s after the click failed under load: "weekly · paused" read after Resume (recurring:121, whole run 2 and 3) and no plan region after Plan (recurring:89, triage-first:80, alone under load). All pass alone on a quieter machine; the lane changed nothing on the schedule path. The specs were wrong to give a ~3.4 s round-trip the default timeout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat:
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/umtool/e2e/recurring.spec.ts b/umtool/e2e/recurring.spec.ts
@@ -6,6 +6,11 @@ import { fileURLToPath } from "node:url";
import * as urls from "./urls";
import { WARM_TIMEOUT, warm } from "./warm";
+/** A schedule write's answer (POST /api/schedules…): each one runs the editor stub's real action in a tsx child
+ * (editor-stub.mjs, spawnSync; about 3.4 s on an idle machine), longer than an expect's 5 s under load. */
+const scheduleAnswered = (page: Page) =>
+ page.waitForResponse((r) => new URL(r.url()).pathname.startsWith("/api/schedules") && r.request().method() !== "GET", { timeout: 60_000 });
+
// ---------------------------------------------------------------------------
// RECURRING REPORTS (plans/umtool-redesign.md, R5) over the editor stub, which
// runs the REAL report-schedule action and store over the fixture's article
@@ -99,7 +104,9 @@ test("Create → A recurring report: a series, planned (first tick, model, cap),
await expect(form.getByRole("combobox", { name: "cadence" })).toHaveValue("weekly");
await expect(form.getByRole("combobox", { name: "day of the week" })).toHaveValue("1");
await shoot(page, "create-recurring");
+ const planned = scheduleAnswered(page);
await form.getByRole("button", { name: "Plan the schedule" }).click();
+ await planned;
const plan = form.getByRole("region", { name: "plan recurring report" });
await expect(plan).toContainText("Series r5-cohost · weekly · Mon 06:00 · first tick Mon 06:00");
await expect(plan.locator("[data-plan-first-tick]")).toHaveAttribute("data-plan-first-tick", /T\d\d:00:00\.000Z$/);
@@ -160,9 +167,13 @@ test("the series page: Tick now makes an edition over whole days; again at once,
await expect(page.locator("[data-series-spent]")).toHaveAttribute("data-series-spent", "0.37");
await shoot(page, "series-page");
+ let answered = scheduleAnswered(page);
await page.getByRole("button", { name: "Pause schedule" }).click();
+ await answered;
await expect(page.locator("[data-schedule-chip]")).toHaveText(/weekly · paused/);
+ answered = scheduleAnswered(page);
await page.getByRole("button", { name: "Resume schedule" }).click();
+ await answered;
await expect(page.locator("[data-schedule-chip]")).toHaveText(/weekly · next Mon 06:00/);
await page.getByRole("button", { name: "Edit cadence" }).click();
const edit = page.getByRole("form", { name: "edit cadence" });
diff --git a/umtool/e2e/triage-first.spec.ts b/umtool/e2e/triage-first.spec.ts
@@ -5,6 +5,11 @@ import { fileURLToPath } from "node:url";
import * as urls from "./urls";
import { WARM_TIMEOUT, warm } from "./warm";
+/** A schedule write's answer (POST /api/schedules…): each one runs the editor stub's real action in a tsx child
+ * (editor-stub.mjs, spawnSync; about 3.4 s on an idle machine), longer than an expect's 5 s under load. */
+const scheduleAnswered = (page: Page) =>
+ page.waitForResponse((r) => new URL(r.url()).pathname.startsWith("/api/schedules") && r.request().method() !== "GET", { timeout: 60_000 });
+
// ---------------------------------------------------------------------------
// TRIAGE FIRST (plans/umtool-redesign.md, R6) over the editor stub, which runs
// the REAL report-schedule action, store and tick over the fixture's article
@@ -96,7 +101,9 @@ test("Create → A recurring report → Watch: its terms, topics and threshold,
await expect(form.getByRole("textbox", { name: "strong flags" })).toHaveValue("1");
await expect(form.getByRole("textbox", { name: "flags of any strength" })).toHaveValue("3");
await shoot(page, "create-watch");
+ const planned = scheduleAnswered(page);
await form.getByRole("button", { name: "Plan the schedule" }).click();
+ await planned;
const plan = form.getByRole("region", { name: "plan recurring report" });
await expect(plan).toContainText("Watch r6-watch · weekly · Mon 06:00");
await expect(plan.locator("[data-plan-triage]")).toContainText(/triage first on \S+ \(\$0\): escalates on 1 strong or 3 weak · at most \d+ escalations? a day; no article until one does/);