Skip to content

Commit 08d0b81

Browse files
The face-agreement check waits for the frame it judges
CI caught the one-shot read pairing the new face with a list it had not re-laid yet — new glyphs over old rects, transient under load now that the background Bible downloads share the machine with the switch. Polled: the defects this test guards (a scale applied on one thread, a stale turn-cache) disagree permanently, so the poll still goes red on both.
1 parent bc420c2 commit 08d0b81

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

apps/web/e2e/font-face.spec.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ test("switching the scripture face re-lays the chapter, at the face's optical si
126126
})
127127
.not.toBe(before.lastY);
128128

129+
// POLLED, not read once. The probe reports the LAST paint, and a frame can
130+
// land between the lastY poll above and a one-shot read here that pairs the
131+
// new face with a list the new face has not re-laid yet — "new glyphs over
132+
// old rects", transiently, while relayouts queue behind the background
133+
// Bible downloads on a loaded machine (CI caught exactly this at 44 px,
134+
// 2026-08-29). The poll cannot mask the defects this test exists for: a
135+
// scale applied on one thread only, or a stale turn-cache serving the old
136+
// face's geometry, disagree PERMANENTLY — the poll times out red on both
137+
// mutations above, same as the one-shot read did.
138+
await expect
139+
.poll(async () => agreement((await snap(page))!), {
140+
message: "measured and painted widths disagree after the switch",
141+
timeout: 20_000,
142+
})
143+
.toBeLessThan(AGREE_TOL);
144+
129145
const after = (await snap(page))!;
130146
// size × 0.88 (FONT_SCALE["fira-code"]) — the painted px carries the optical
131147
// scale; config.bodySize still says what the reader set.
@@ -134,9 +150,6 @@ test("switching the scripture face re-lays the chapter, at the face's optical si
134150
await defaultPx(page),
135151
"the optical scale must never be written back into the stored size",
136152
).toBe(size);
137-
expect(agreement(after), "measured and painted widths disagree after the switch").toBeLessThan(
138-
AGREE_TOL,
139-
);
140153
});
141154

142155
// The face is a config setting, and settings survive a reload. (It once looked

0 commit comments

Comments
 (0)