Skip to content

trace CLI: request timing cannot be correlated with actions #42172

Description

Problem

When a test is flaky because of a race between a UI action and an in-flight network request, the answer should be derivable from playwright trace output: compare when the request was in flight with when the action ran. Today it isn't, for two reasons:

  • trace requests prints only a duration for each request — no start time — while trace actions prints per-action start times. There is nothing on the request side to line up against the action clock.
  • Failed and route.abort()ed requests never get an end recorded at all: the failure path leaves the HAR entry's time at its -1 default, so even the raw trace data cannot say when such a request stopped.

Proposal

  • When tracing, record a duration for failed/aborted requests, derived from the entry's monotonic start stamp. User-exported HAR files keep the spec-defined value.
  • Add a Start column to trace requests using the same clock and format as the trace actions Time column, and a matching start: line to trace request <id>.

With both in place, "was this request still outstanding when this action ran (or finished)?" becomes a plain timestamp comparison over CLI output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions