feedback4: the real-server suites' long "own battle over" waits poll in slices under the browser's CDP protocol timeout (test/e2e/client.mjs waitForFunctionLong, PROTOCOL_TIMEOUT_MS = the Client's 90 s) — puppeteer runs a page.waitForFunction's whole poll inside one Runtime.callFunctionOn, so watch-bonds.e2e subtest 3's 240 s wait (line 489) died with a bare "Waiting failed" (cause: Runtime.callFunctionOn timed out) whenever the own battle at 1× outlasted 90 s (the 0.1.4 candidate rerun: 152 s ≈ 62 s to COMBAT + 90 s; 65–67 s in isolated runs); reproduced at the same line with a 30 s protocol timeout, which passes with the slices; playtest2.real's 120 s wait had the same gap (a silent 'timeout' round); test/e2e/client-wait.test.js (slices until the deadline, other errors not retried, no Client suite with a plain wait as long as the protocol timeout); a test-harness timing flake, no product change; golden unchanged

This commit is contained in:
sganggs committed 2026-10-06 17:31:01 +08:00
1 parent be9710f31f
commit 5a66f48ad2
4 files changed
+124 -7

No files matched your search

+3 -3
View File
@@ -20,7 +20,7 @@ import { test, describe } from 'node:test';
import assert from 'node:assert/strict';
import { existsSync } from 'node:fs';
import path from 'node:path';
import { Client, ROOT, sleep, hasChrome, startRealServer, problemsOf } from '../e2e/client.mjs';
import { Client, ROOT, sleep, hasChrome, startRealServer, problemsOf, waitForFunctionLong } from '../e2e/client.mjs';
const ENABLED = process.env.SP_E2E === '1' && hasChrome() && existsSync(path.join(ROOT, 'public/assets'));
const ONLY = process.env.SP_P2_REAL || '';
@@ -252,8 +252,8 @@ describe('user playtest #2 item 6 — 前往查看 → 返回战场 in combat (r
await c.waitFor((s) => s.phase === 'COMBAT', 'combat', 60000);
await sleep(1500);
assertNoPen(await battleViewState(c), `R${s0.round} own battle`);
// own battle over while the AI's field still runs
const target = await c.page.waitForFunction(() => {
// own battle over while the AI's field still runs (sliced: longer than the browser's 90 s protocol timeout)
const target = await waitForFunctionLong(c.page, () => {
const s = globalThis.__SP__.store.get();
const r = globalThis.__SP_RUNNER__?.state?.();
const pub = s.match.public;
+4 -3
View File
@@ -30,7 +30,7 @@ import { test, describe } from 'node:test';
import assert from 'node:assert/strict';
import { existsSync } from 'node:fs';
import path from 'node:path';
import { Client, ROOT, sleep, hasChrome, startRealServer, problemsOf } from '../e2e/client.mjs';
import { Client, ROOT, sleep, hasChrome, startRealServer, problemsOf, waitForFunctionLong } from '../e2e/client.mjs';
const ENABLED = process.env.SP_E2E === '1' && hasChrome() && existsSync(path.join(ROOT, 'public/assets'));
const HOST_KIT = ['chess_char_1_10_a', 'chess_char_1_12_a']; // 古米 (坚守), 艾丝黛尔 (萨尔贡)
@@ -485,8 +485,9 @@ describe('DESIGN §20.15 — the bond strip shows the watched teammate\'s bonds
await sleep(1500);
for (const c of [host, guest]) if (!(await c.st()).ready) await c.click('.readybtn');
await host.waitFor((s) => s.phase === 'COMBAT', 'combat', 60000);
// the own battle over while a teammate's still runs
const target = await host.page.waitForFunction(() => {
// the own battle over while a teammate's still runs (at 1× it may last longer than the browser's 90 s protocol
// timeout, which cut a plain page.waitForFunction off with a bare "Waiting failed")
const target = await waitForFunctionLong(host.page, () => {
const s = globalThis.__SP__.store.get();
const pub = s.match.public;
if (pub?.phase !== 'COMBAT') return { gone: true };