From 158888d04f310f7dc99a005c2e171a8132c2ca6d Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 26 Oct 2026 03:42:02 +0800 Subject: [PATCH] gui tests: routing-model-rest waits for the frame that rests the Opus row (#2115) The test read the Opus row's rest class as soon as the row was in the list. render() marks it on the next frame, so under a full Routing run (112 files, concurrency 6) it once read false: "old@x.test: the Opus row doesn't rest" (webkit zh 1100px). It now waits, a frame at a time, for up to 5 s for the class, then asserts as before; a row that never rests still fails, 5 s later. Run: routing-model-rest alone, 20 pass, 0 fail. The race was not reproduced by injecting a delay; the failure was seen once, in the full run of the previous commit. --- internal/gui/tests/routing-model-rest.test.cjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/gui/tests/routing-model-rest.test.cjs b/internal/gui/tests/routing-model-rest.test.cjs index 64f60ea0d..8a5a67067 100644 --- a/internal/gui/tests/routing-model-rest.test.cjs +++ b/internal/gui/tests/routing-model-rest.test.cjs @@ -111,6 +111,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", for (const user of ["old@x.test", "me@x.test"]) { const opus = stage(user, "claude-opus-5.5"), flash = stage(user, "gemini-3.8-flash"); await opus.first().waitFor({ state: "attached" }); + // a row is in before the frame that says how it rests: under load + // the class was read before that frame came (#2115) + await opus.first().evaluate((e) => new Promise((done) => { const ok = () => e.classList.contains("rest") ? done() : requestAnimationFrame(ok); setTimeout(done, 5000); ok(); })); assert.equal(await opus.count(), 1, `${user}: one Opus row`); assert.equal(await flash.count(), 1, `${user}: one gemini-3.8-flash row`); assert(!(await flash.evaluate((e) => e.classList.contains("rest"))), `${user}: gemini-3.8-flash rests with Opus`);