Skip to content

feat(trace): load trace files independently, produce a single context entry - #42350

Open
Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:trace-single-context-entry
Open

feat(trace): load trace files independently, produce a single context entry#42350
Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:trace-single-context-entry

Conversation

@dgozman

@dgozman Dmitry Gozman (dgozman) commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

This prepares to being able to mix and match events from different contexts between trace files.

  • TraceLoader loads each .trace, .network and .stacks file independently, without matching them by the file name prefix, and merges everything into a single ContextEntry.
  • Per-file clock alignment, stepId-based action merging and origin-dependent metadata resolution move from TraceModel to the loader.
  • Network files derive their time origin from the first resource and reuse the format version learned from trace files; stacks are applied through a global call id map.

… entry

TraceLoader now loads each .trace, .network and .stacks file into its own
entry without matching them by the file name prefix, then merges everything
into a single ContextEntry: per-file clock alignment, action merging by
stepId, and origin-dependent metadata resolution all move from TraceModel
to the loader. Network files derive their time origin from the first
resource and reuse the format version learned from trace files. Stacks
are applied through a global call id map.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/cli-core.spec.ts:123 › select @mcp-macos-latest-chrome

8141 passed, 1361 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

7 flaky ⚠️ [chromium-library] › library/browsercontext-page-event.spec.ts:160 › should work with Shift-clicking `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/browsercontext-reuse.spec.ts:361 › reuse launch › should work with routeWebSocket `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:294 › screencast › should capture navigation `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`

51277 passed, 1238 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures.

🟢 The one failure is a pre-existing flake — this PR is clear

mcp/cli-core.spec.ts:123 › select timed out on macOS Chrome, but the same test times out on main, and this PR only touches trace-loading code that the test never exercises.

Details

Across the two latest merged reports there's exactly one real failure; the "tests 1" run had only flaky results. This PR reworks trace file loading (traceLoader.ts, traceModel.ts, traceModernizer.ts, entries.ts, and the trace-viewer UI) — none of the failing paths reach it.

Pre-existing flake / infra

  • [chrome] › mcp/cli-core.spec.ts:123 › select (@mcp-macos-latest-chrome) — timeout flake. The failure signature is Test timeout of 30000ms exceeded. The same test hits the identical 30s timeout on main (mcp-macos-latest-chromium, run 30034115836) and also failed on main for mcp-windows-latest-firefox (run 30020951381) — both on SHAs this PR can't be responsible for. Its final verdict never flips to failed in the aggregated DB: 0 failures across 733 chrome runs (and 0 across webkit/firefox/msedge/chromium). This PR's changes are confined to trace loading and the trace viewer, which the MCP select CLI flow doesn't touch.

Triaged by the Playwright bot - agent run

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need additional context to understand / appreciate why this is needed.

contextEntries.push(contextEntry);
}

for (const networkName of networkNames) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am expecting networkNames to always follow tracingNames after Devin's refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants