You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): add --trace flag to dump Perfetto-compatible profile
When `--trace` is passed (or `performance.trace: true` is set in config),
each test file's lifecycle is recorded as Perfetto-compatible events and
written at run end to `<rootPath>/.rstest/trace-<timestamp>.json`.
The trace contains:
- per-phase `ph: 'X'` spans (prepare, envSetup, load, setupFiles, collect,
tests, coverage, teardown)
- per-suite / per-case `ph: 'X'` spans via the runner's existing lifecycle
hooks (zero intrusion into runner.ts)
- heap-usage counter samples (`ph: 'C'`) at each phase boundary so memory
pressure shows up as a track in Perfetto UI
Each `PhaseTracker` (one per test file) gets a unique per-process `tid`,
so workers with `isolate: false` render multiple files as distinct thread
tracks instead of collapsing onto the first file's label. A tiny
localhost HTTP server on port 9001 (the only port allowed by Perfetto
UI's CSP) starts in TTY runs so the printed `ui.perfetto.dev` deep-link
loads the trace directly; in non-TTY (CI) runs the file is written
without spawning the server so `rstest run` exits cleanly.
0 commit comments