tests: annotate documented dwells in group-Y presence specs (determinism lint)
lint:determinism failed the staging deploy (run 33200086355) on 5 lines in the presence specs committed 8/28: overlay-repaint dwells before settledShot, the best-effort #canvas focus, and the sampling cadences of the two explicit presence-eviction poll loops. All are intentional; annotate them the way 3d-viewer-*.spec.ts does so the guard accepts them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LvvARNMxQrq17vogn3REMU
This commit is contained in:
parent
f6b0aaf122
commit
f409294c77
3 changed files with 7 additions and 5 deletions
|
|
@ -166,14 +166,16 @@ for (const kind of ["selection", "xsel"] as const) {
|
|||
// WIRE1 is deleted through a real SCH_COMMIT — the same path a remote
|
||||
// apply (peer deleted it) or a local menu delete takes.
|
||||
expect(await removeItem(page, WIRE1)).toBe(true);
|
||||
await page.waitForTimeout(1500);
|
||||
// Documented interaction dwell: the overlay repaint has no observable signal
|
||||
// — settledShot below compares stable frames, this only lets it queue.
|
||||
await page.waitForTimeout(1500); // eslint-disable-line -- documented interaction dwell
|
||||
const afterDelete = await settledShot(canvas);
|
||||
|
||||
// Ground truth for "what the overlay should look like now": force the
|
||||
// overlay to rebuild from the SAME peer snapshot — WIRE1 no longer
|
||||
// resolves, so nothing is drawn for it.
|
||||
await setRemote(page, { peers: [peer] });
|
||||
await page.waitForTimeout(1500);
|
||||
await page.waitForTimeout(1500); // eslint-disable-line -- documented interaction dwell (overlay rebuild, no observable)
|
||||
const afterRepush = await settledShot(canvas);
|
||||
|
||||
expect(
|
||||
|
|
@ -223,7 +225,7 @@ test("local emit: keyboard Delete on the canvas does publish the empty selection
|
|||
// Give the wx canvas keyboard focus with a click on empty sheet space (this
|
||||
// clears any selection — the programmatic select comes after).
|
||||
await page.mouse.click(box!.x + box!.width * 0.5, box!.y + box!.height * 0.95);
|
||||
await page.locator("#canvas").focus().catch(() => {});
|
||||
await page.locator("#canvas").focus().catch(() => {}); // documented best-effort: wx canvas may reject DOM focus after the click already focused it
|
||||
const id = await page.evaluate(() =>
|
||||
(window as unknown as W).Module.kicadCollabTestSelectFirst(),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ for (const close of [true, false]) test(`diag: what bob receives after alice ${c
|
|||
const before = await bob.evaluate((since) => (window as any).__awLog.filter((e: any) => e.type === 1 && e.t < since).flatMap((e: any) => e.ents.map((x: any) => `${new Date(e.t).toISOString().slice(14, 19)} ch${e.ch} cid=${x.cid} clk=${x.clk} ${x.user}`)), tCut);
|
||||
console.log(`[diag] bob inbound awareness BEFORE cut (last 12):\n ${before.slice(-12).join('\n ')}`);
|
||||
for (let i = 1; i <= 4; i++) {
|
||||
await bob.waitForTimeout(10000);
|
||||
await bob.waitForTimeout(10000); // eslint-disable-line -- documented sampling dwell: diag probe cadence inside an explicit loop
|
||||
const present = await bob.locator('[data-presence-user="alice"]').count();
|
||||
const aliceWs = await alice.evaluate(() => (window as any).__wsList.map((w: any) => ({ url: w.url.slice(0, 60), state: w.ws.readyState, t: w.t })));
|
||||
const log = await bob.evaluate((since) => (window as any).__awLog.filter((e: any) => e.t >= since), tCut);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ for (const mode of ['half-open', 'unclean-close'] as const) {
|
|||
const present = await bob.locator('[data-presence-user="alice"]').count();
|
||||
seen.push(`+${Math.round((Date.now() - t0) / 1000)}s:${present}`);
|
||||
if (present === 0) { ms = Date.now() - t0; break; }
|
||||
await bob.waitForTimeout(5000);
|
||||
await bob.waitForTimeout(5000); // eslint-disable-line -- documented sampling dwell: presence-eviction probe cadence inside an explicit bounded loop
|
||||
}
|
||||
const sockets = await alice.evaluate(() => (window as unknown as { __wsReport(): unknown }).__wsReport());
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
|
|||
Loading…
Reference in a new issue