commit 22b24f3646d664683a9e06147b51414c3d44cc68
parent d9d97a260c38feb15121c4e3001965f6c31ffd35
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 18 Aug 2026 11:29:01 -0400
faces.spec: detect each corner once for the whole file
Two tests here walk the entire queue, and a detection is ~0.94s of python
decoding five frames and running YuNet on each. Twenty-two of those is twenty
seconds of four-core load dropped into the middle of a serial suite.
With it in, undo.spec's "a card remembers the window it was left on" failed
reproducibly in the full run and passed in every isolated one -- and the value
it received was the NEXT card's untouched window, not a slow-arriving one. That
is Backspace consuming a capture instead of navigating: the waveform drag
registered as a capture gesture under load. A pre-existing race in the um deck,
not something this feature introduced, but making the suite carry twice the
work it needs is not the place to argue about it.
Memoised per file, so the second walk is free. Full suite: 93/93, twice.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/umtool/e2e/faces.spec.ts b/umtool/e2e/faces.spec.ts
@@ -46,12 +46,26 @@ const view = async (request: APIRequestContext): Promise<FaceView> => {
return (await r.json()) as FaceView;
};
+// Memoised for the whole FILE, not per test.
+//
+// A detection is ~0.94s of python decoding five frames and running YuNet on
+// each, and two tests here walk the entire queue. Twenty-two of those is a
+// solid twenty seconds of four-core load in the middle of a serial suite, and
+// the deck spec that runs after this one drags a mouse across a waveform and
+// measures what it selected. Load is not supposed to change that, but making
+// the suite carry twice the work it needs to is not the place to prove it.
+const seen = new Map<string, Detection>();
+
const detect = async (request: APIRequestContext, e: Entry): Promise<Detection> => {
+ const hit = seen.get(e.key);
+ if (hit) return hit;
const r = await request.get(
`/api/face/detect?video=${encodeURIComponent(e.video)}&at=${e.frameAt}`,
);
expect(r.ok(), `detect ${e.key} -> ${r.status()}`).toBe(true);
- return (await r.json()) as Detection;
+ const d = (await r.json()) as Detection;
+ seen.set(e.key, d);
+ return d;
};
const attr = async (page: Page, sel: string, name: string): Promise<string> =>