test(player): a Safari perf run that fails says which wait timed out and why (#7347)

* test(player): a Safari perf run that fails says which wait timed out

* test(player): a Safari run that never starts loading a video says so
This commit is contained in:
Miguel Ángel
2026-11-07 12:02:22 +00:00
committed by GitHub
parent 336abaa80f
commit 7b1d9ccebf
2 changed files with 9 additions and 2 deletions
@@ -116,7 +116,14 @@ export async function bench(cfg) {
const idle = await recordFrames(1000);
host.play();
await until(() => runtime.isPlaying(), 5_000, "isPlaying");
await until(() => runtime.isPlaying(), 5_000, "isPlaying").catch((e) => {
// Safari sometimes reports a source as loading and never requests it; a reload does not help.
const unstarted = videos()
.filter((v) => v.readyState === 0 && v.networkState === 2)
.map((v) => v.currentSrc.split("/").pop());
if (unstarted.length === 0) throw e;
throw new Error(`${e.message}: the browser never started loading ${unstarted.join(", ")}`);
});
countOps = true;
const decodedBefore = decoded();
const droppedTimeline = [];
+1 -1
View File
@@ -262,7 +262,7 @@ async function runFilm(base: string, browser: Browser, origin: string, fixture:
window.__bench = null;
window.__hfBench(arguments[0]).then(
(r) => { window.__bench = { ok: r }; },
(e) => { window.__bench = { error: String(e && e.stack || e) }; });`,
(e) => { window.__bench = { error: [String(e), e && e.stack].filter(Boolean).join("\\n") }; });`,
args: [{ playMs: PLAY_MS, seekFractions: SEEK_FRACTIONS }],
});
const deadline = Date.now() + 180_000;