Repository navigation
test(interaction-harness): a traced long task carries its thread time - #9874
Conversation
A trace's long tasks reported wall time only. On a busy machine, wall time stretches with the machine, not with the page's work. Each traced long task now also carries `threadMs`, the main thread's own run time from the trace's thread clock. The split into the page's tasks and the harness's reads moves into `longTasksOf`, and a unit test checks how it reads a trace.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report🔎 Preview ·
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. It starts once the pull request is marked ready for review and a maintainer adds the ci:run label, since the branch lives in a fork.
The new threadMs leaves every existing caller's start and durationMs unchanged, and the longTasksOf test fails without the change and passes with it. One optional addition: no case has a thread duration above the wall duration, so a case such as task(0, 60, 61) expecting threadMs: 60 would pin the cap that TracedTask.threadMs documents.
[Automated review]
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head.
The new threadMs leaves every existing caller's start and durationMs unchanged, and the longTasksOf test fails without the change and passes with it. One optional addition: no case has a thread duration above the wall duration, so a case such as task(0, 60, 61) expecting threadMs: 60 would pin the cap that TracedTask.threadMs documents.
[Automated review]
Maintainer impact
A trace's long tasks reported wall time only. On a busy machine, wall time stretches with the machine, not with the page's work. So a "no long task" check fails on a loaded box when the page's own work is well under the bound.
Intended invariant
A claim about the page's own work judges the main thread's own run time. A claim about a blocking wait (a synchronous request,
Atomics.wait) still judges wall time, since a waiting thread gains wall time but no thread time.Change
threadMsbesidedurationMs: the main thread's run time from the trace's thread clock, capped at the wall time. A task with no thread clock reads at its wall time, so nothing weakens silently.longTasksOf, which a unit test reads without a browser.The harness only. Its first user is the Lab RefreshControl's interaction spec (#9865).
Evidence
trace.longTasks.test.tsfails 4 of 4 against main'strace.ts(longTasksOfis not a function).devtoolsTasks, and no task of 50 ms or less. The harness's node tests pass.internal/interaction-harnesschanges;longTasksanddevtoolsTaskskeepstartanddurationMs.Scope
Testing
Local gates at fe28f88, on main: the harness's node tests (7 files / 129), its type check, strict ESLint and
pnpm lintwith 0 errors, Prettier, andreview:prewith no findings.