Repository navigation
test(interaction-harness): a long task is the page's own work - #10510
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. The thread-time rule fixes the stretched short tasks it targets, but it moves the same load sensitivity into the harness's own long-task proof.
harness.interaction.browser.spec.ts:2562-2570still expects the 60 ms timer, click and direct page spins intrace.longTasks, but under load a 60 ms wall-clock spin gets well under 50 ms of thread time and now lands instretchedTasks, so with the renderer descheduled most of the time that test failed 2 of 2 on this branch and passed onmain; asserting over[...trace.longTasks, ...trace.stretchedTasks]fixes it, and the README sentence "A test's ownpage.evaluatestays a long task" should say the same.
Worth a line in the description: the nightly perf sampler's mountLongTaskMs (apps/sandbox/perf/measure.ts) sums longTasks, so its trend will step down when this lands. The new unit cases fail against main's trace.ts and pass here, as described.
[Automated review]
traceRendering counted a task as long on its wall time, so a renderer the machine kept off the CPU failed a proof's "no long task" claim with 51 ms of wall time and 11.5 ms of the page's own work. A task is now long when its main thread ran longer than 50 ms. A task only the wall clock stretched past 50 ms goes to stretchedTasks, with both times, so a claim about a blocking wait still reads it.
99d9588 to
7455345
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It is a draft from a fork, so CI starts when it is marked ready for review with a maintainer's ci:run label on it.
The earlier request is resolved: the harness self-test now judges a test's own evaluate over longTasks and stretchedTasks, and under simulated renderer descheduling it passes where reading longTasks alone fails.
Optional follow-ups:
apps/sandbox/perf/measure.ts:27could say thatmountLongTaskMspicks tasks by thread time and sums their wall time.- PopoverTouchMotion's own
threadMs > 50filter (PopoverTouchMotion.interaction.browser.spec.ts:762) is now redundant.
[Automated review]
|
/approve-spec 8ede760 |
There was a problem hiding this comment.
Approved. CI finished with one failure that this change does not cause: the WebKit interaction leg fails "a play whose onEvent holds its lift back past the stillness interval fails by name" (harness.interaction.browser.spec.ts:434), a touch-pacing test whose result depends on wall-clock timing in touch.ts, which this pull request does not change. Re-run that leg before merging; every other check, including all six Chromium interaction legs, passes.
Since the last review this head only merges main, cleanly; the thread-time split, its unit cases and the harness self-test are unchanged, and the earlier request stays resolved.
Optional follow-ups:
apps/sandbox/perf/measure.ts:27could say thatmountLongTaskMspicks tasks by thread time and sums their wall time.- PopoverTouchMotion's own
threadMs > 50filter (PopoverTouchMotion.interaction.browser.spec.ts:746) is now redundant.
[Automated review]
|
/approve-spec 693864f |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The new head only merges main; the pull request's own changes are unchanged, and what main brought in leaves the classification and the self-test as they were. The thread-time split in longTasksOf is pinned by the new unit case, which fails against the old wall-time classification.
Non-blocking follow-ups:
apps/sandbox/perf/measure.ts:27could say thatmountLongTaskMspicks tasks by thread time and sums their wall time.- PopoverTouchMotion's own
threadMs > 50filter (PopoverTouchMotion.interaction.browser.spec.ts:746) is now redundant. - ChatLayoutKeyboard's Layout and Paint failure message (
ChatLayoutKeyboard.interaction.browser.spec.ts:647) could liststretchedTaskstoo, so a task the machine stretched still shows when that test fails.
[Automated review]
|
/approve-spec 15269bf |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The new head only merges main again; the pull request's own changes are unchanged, and nothing main brought in reads or writes the long-task lists. The thread-time split in longTasksOf is pinned by the new unit case, which fails against the old wall-time classification. The one failing check so far, test-node (1/4), fails in packages/cli/api/build/tree.test.mjs:293, which this pull request does not touch; main has since updated that expectation, so merging main again clears it.
Non-blocking follow-ups:
apps/sandbox/perf/measure.ts:27could say thatmountLongTaskMspicks tasks by thread time and sums their wall time.- PopoverTouchMotion's own
threadMs > 50filter (PopoverTouchMotion.interaction.browser.spec.ts:749) is now redundant. - ChatLayoutKeyboard's Layout and Paint failure message (
ChatLayoutKeyboard.interaction.browser.spec.ts:647) could liststretchedTaskstoo, so a task the machine stretched still shows when that test fails.
[Automated review]
|
/approve-spec 1e5b5b1 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The new head only merges main again; the pull request's own changes are unchanged, and nothing main brought in reads or writes the long-task lists. The thread-time split in longTasksOf is pinned by the new unit case, which fails against the old wall-time classification, and under a simulated loaded machine the harness self-test passes reading both lists and fails reading longTasks alone. No check has failed on this head so far.
Non-blocking follow-ups:
apps/sandbox/perf/measure.ts:27could say thatmountLongTaskMspicks tasks by thread time and sums their wall time.- PopoverTouchMotion's own
threadMs > 50filter (PopoverTouchMotion.interaction.browser.spec.ts:749) is now redundant. - ChatLayoutKeyboard's Layout and Paint failure message (
ChatLayoutKeyboard.interaction.browser.spec.ts:647) could liststretchedTaskstoo, so a task the machine stretched still shows when that test fails.
[Automated review]
Maintainer impact
traceRenderingcounted a task as long on its wall time. On a loaded runner, a proof's "no long task" claim then failed on a renderer the machine kept off the CPU: a LightboxZoom proof failed 2 of 20 runs in Chromium at four workers on two cores, each on one task of 50.4 to 51.2 ms of wall time and 11.3 to 11.7 ms of the page's own work. The README already said a claim about the page's own work judges thread time.Intended invariant
RenderingTrace.longTasksholds the page's own tasks whose main thread ran longer than 50 ms. A task that only the wall clock stretched past 50 ms is reported apart, with both times, so nothing is dropped.Change
trace.ts:longTasksOfputs a page task inlongTaskswhen its thread time passes 50 ms, else in a newstretchedTaskslist. The harness's reads stay indevtoolsTasks. A task without a thread clock reads at its wall time.trace.longTasks.test.ts: the 51 ms wall / 11.5 ms thread case goes tostretchedTasks; an 80 ms wall / 60 ms thread case stays long.Atomics.wait) judgesstretchedTaskstoo.Evidence
trace.ts(227db17, NOT FOR LANDING) fail 3 of 5: the stretched task lands inlongTasks, and nostretchedTaskslist exists. Here they pass.longTasks(BottomSheetDetent, Wheel, LightboxZoom, PopoverTouchMotion, SegmentedControl, Switch, usePager and RefreshControl), each claiming the page's own work. A task stretched past 50 ms of wall time but with 50 ms or less of thread time no longer fails them; it is instretchedTasks. PopoverTouchMotion already filtered onthreadMs > 50. The threshold is unchanged.Layout or Paint, long-task and trace tests): 24 of 24 pass. At four workers on two cores, that self-test fails 6 of 6 readinglongTasksalone, and passes 6 of 6 reading both.mountLongTaskMssumslongTasks, so its trend steps down where a task was only stretched.Scope
Testing
pnpm review:pre: 0 findings, merge into main clean.