Skip to content

fix(trace): settle in-flight captures before writing a per-test slice - #394

Merged
vishnuv688 merged 7 commits into
mainfrom
fix/391-selenium-mobile-web-dom-capture
Sep 29, 2026
Merged

vishnuv688 merged 7 commits into
mainfrom
fix/391-selenium-mobile-web-dom-capture

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What & why

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Polish (an improvement to an existing feature)
  • Breaking change (existing behavior changes for users)
  • Documentation
  • Internal (build, CI, dependencies, tooling)

Packages touched

  • shared (types and contracts)
  • core (framework-agnostic capture/reporting)
  • elements (published element/snapshot API — @wdio/elements)
  • service (WebdriverIO adapter)
  • nightwatch-devtools (Nightwatch adapter)
  • selenium-devtools (Selenium adapter)
  • selenium-devtools-py (Selenium Python adapter)
  • backend (server)
  • app (UI)
  • script (page-injected runtime)
  • trace (Trace mode)

Notes for reviewers

Screenshots / recordings

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes trace capture timing for per-test slices.

The PR appears safe to merge based on the reviewed changes.

Findings

  1. P1 Stuck metadata delays every test ▶

Summary

This PR waits for in-flight captures before writing per-test trace slices and uses newly recorded boundaries to keep later tests out of earlier slices. It also bounds WDIO's session viewport read and removes string-valued inline event handlers from replayed nodes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Record slice boundary and capture index] --> B[Flush slice]
  B --> C[Wait for slice captures and session metadata]
  C --> D[Resolve next slice boundary]
  D --> E[Write bounded trace slice]
  E --> F[Finalization waits for pending work]
  F --> G[Write artifacts manifest]
Loading

Reviews (6) · Last reviewed commit: "fix(service): bound the viewport read so..."

Comment thread packages/core/src/trace-finalizer.ts Outdated
Comment thread packages/core/src/trace-finalizer.ts Outdated
Comment thread packages/core/src/trace-finalizer.ts Outdated
@vishnuv688 vishnuv688 linked an issue Sep 28, 2026 that may be closed by this pull request
Comment thread packages/core/src/trace-finalizer.ts Outdated
Comment on lines +182 to +183
...sessionWide,
...Array.from(ctx.pendingCaptures ?? []).slice(sliceFrom)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Stuck metadata delays every test

If WDIO’s session-metadata driver read never settles, every per-test flush waits on that same promise for five seconds, even after an earlier flush timed out. Because the test-end hook awaits each flush, an affected suite incurs another five-second delay after every test instead of degrading once to fallback metadata.

@vishnuv688
vishnuv688 merged commit 77c720a into main Sep 29, 2026
9 checks passed
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.

Per-test trace slices carry no DOM on an Appium mobile-web session

1 participant