commit eae4f2daae7e704e6e9dbe3d230acca410ae79d1
parent 10a31fd35925499464533db9ea5870620d54de9d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 30 Oct 2026 14:51:57 -0400
umtool e2e learned-spellings: wait for the stub's spawned tsx, not the default 5 s
Each plan, promote, remove and proposal is a cold `tsx opsStub.ts` the editor
stub spawns: ~3 s idle, 15–25 s beside a render's encode (load 48), so the
first expectation after one timed out under load on any branch.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/umtool/e2e/learned-spellings.spec.ts b/umtool/e2e/learned-spellings.spec.ts
@@ -56,6 +56,13 @@ async function shoot(page: Page, name: string) {
await page.setViewportSize({ width: 1280, height: 720 });
}
+// Every plan, promote, remove and proposal is one `tsx opsStub.ts` the editor stub
+// SPAWNS (fixtures/editor-stub.mjs): a cold start of the whole controller graph,
+// ~3 s on an idle machine and 15–25 s beside a render's encode (measured
+// 2026-10-30, load 48). The first expectation after each one waits for that, not
+// for the default 5 s.
+const STUB = { timeout: 45_000 };
+
async function api(page: Page, body: Record<string, unknown>) {
const r = await page.request.post("/api/schedules", { data: body });
const b = (await r.json()) as Record<string, unknown>;
@@ -123,8 +130,8 @@ test("Promote to search alias: the plan (the list, the alias as written), then C
await panel.locator("[data-learned-spelling='Vote Rigg']").click();
await panel.getByRole("button", { name: "Promote to search alias" }).click();
const plan = panel.getByRole("region", { name: "promote Vote Rigg" });
- await expect(plan).toHaveAttribute("data-promote-action", "new");
- await expect(plan).toHaveAttribute("data-promote-to", "global");
+ await expect(plan).toHaveAttribute("data-promote-action", "new", STUB);
+ await expect(plan).toHaveAttribute("data-promote-to", "global", STUB);
await expect(plan.locator("[data-promote-why]")).toHaveText('A new alias "Ada Ballot" firing on "Ada Ballot" and "Vote Rigg".');
await expect(plan).toContainText("ada ballot, vote rigg");
await expect(plan).toContainText("\\bAda Ballot\\b|\\bVote Rigg\\b");
@@ -133,16 +140,16 @@ test("Promote to search alias: the plan (the list, the alias as written), then C
const select = plan.getByRole("combobox", { name: "Alias list" });
await expect(select.locator("option")).toHaveText(["Global (every site)", "priv", "pub"]);
await select.selectOption("priv");
- await expect(plan).toHaveAttribute("data-promote-to", "priv");
+ await expect(plan).toHaveAttribute("data-promote-to", "priv", STUB);
await expect(plan).toContainText("sites/priv/search-aliases.json");
await select.selectOption("global");
- await expect(plan).toHaveAttribute("data-promote-to", "global");
+ await expect(plan).toHaveAttribute("data-promote-to", "global", STUB);
await expect(plan.locator("[data-promote-file]")).toHaveText("search-aliases.json");
expect(existsSync(ALIASES)).toBe(false);
await shoot(page, "learned-promote-plan");
await expect(plan.getByRole("button", { name: "Confirm promote" })).toBeFocused();
await plan.getByRole("button", { name: "Confirm promote" }).click();
- await expect(panel.locator("[data-learned-status]")).toContainText("“Vote Rigg” is a search alias in the global list");
+ await expect(panel.locator("[data-learned-status]")).toContainText("“Vote Rigg” is a search alias in the global list", STUB);
await expect(panel.locator("[data-learned-spelling='Vote Rigg']")).toHaveAttribute("data-promoted", "global");
const written = JSON.parse(readFileSync(ALIASES, "utf8"));
expect(written.aliases.at(-1)).toEqual({ id: "ada-ballot", label: "Ada Ballot", triggers: ["ada ballot", "vote rigg"], suggestion: "\\bAda Ballot\\b|\\bVote Rigg\\b", useRegex: true, enabled: true, note: "learned by watch r63-watch from sitechan/sv1 at 0:03" });
@@ -150,7 +157,7 @@ test("Promote to search alias: the plan (the list, the alias as written), then C
await panel.locator("[data-learned-spelling='Vote Rick']").click();
await panel.getByRole("button", { name: "Promote to search alias" }).click();
await panel.getByRole("region", { name: "promote Vote Rick" }).getByRole("button", { name: "Keep it" }).click();
- await expect(panel.getByRole("region", { name: "promote Vote Rick" })).toHaveCount(0);
+ await expect(panel.getByRole("region", { name: "promote Vote Rick" })).toHaveCount(0, STUB);
});
test("Remove: plan, then confirm — gone, blocked, and a new proposal pass does not learn it again", async ({ page }) => {
@@ -160,13 +167,13 @@ test("Remove: plan, then confirm — gone, blocked, and a new proposal pass does
await panel.locator("[data-learned-spelling='Vote Rick']").click();
await panel.getByRole("button", { name: "Remove" }).click();
const region = panel.getByRole("region", { name: "remove Vote Rick" });
- await expect(region).toContainText("It is never learned again");
+ await expect(region).toContainText("It is never learned again", STUB);
await expect(region.getByRole("button", { name: "Confirm remove" })).toBeFocused();
await region.getByRole("button", { name: "Confirm remove" }).click();
- await expect(panel.locator("[data-learned-spelling]")).toHaveCount(1);
+ await expect(panel.locator("[data-learned-spelling]")).toHaveCount(1, STUB);
expect(learned("r63-watch").blocked).toMatchObject([{ spelling: "Vote Rick", means: "Ada Ballot" }]);
await panel.getByRole("button", { name: "Propose spellings" }).click();
- await expect(panel.locator("[data-learned-status]")).toContainText("Proposal pass queued");
+ await expect(panel.locator("[data-learned-status]")).toContainText("Proposal pass queued", STUB);
await expect(panel.locator("[data-learned-status]")).toContainText("asks about Ada Ballot");
await page.reload();
await expect(page.locator("[data-series-learned] [data-learned-spelling]")).toHaveCount(1);