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
{{ message }}
Repository navigation
Commit 28e6bf8
Browse filesBrowse the repository at this point in the historyBrowse files
Keep the time spent retrying on a folded command's row (#637)
* Keep the time spent retrying on a folded command's row
Each adapter folds a command's repeated polls into one row, and the fold
took the last poll's start, so the wait before it fell out of the trace.
A WebdriverIO expect matcher's row, folded into its read, started after
its ten seconds of retrying and lasted one read. A folded row now keeps
the earliest start of the rows it joins, through one rule in core used
by the WebdriverIO, Nightwatch and Selenium replace paths, and an expect
row starts when its matcher began.
Closes#628
* Assert the retried row's first start directly
The first and retried rows are one object, since the retry replaces the
row in place, so comparing their starts passed whatever the retry wrote.
The test now checks the first attempt's own start.
Keep the time spent retrying on a command's row. A command that polled several times, folded into one row, now starts at its first poll instead of its last, and a WebdriverIO `expect` matcher's row starts when the matcher began, so its retrying (up to the default 10 s wait) shows on the row instead of as an empty gap before it.
Copy file name to clipboardExpand all lines: packages/core/CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Owns the framework-agnostic capture, reporting and transport logic that the thre
8
8
-**A poll that failed under a wait that did not fail is not a failure.** Readers use shared `effectiveFailure` (`packages/shared/src/command-failure.ts`), not `commandFailure`. Under a failed wait, its children keep their errors.
9
9
-**BiDi is auto-attached in Service and Selenium.** Nightwatch is opt-in via `bidi: true` plus `webSocketUrl: true` in capabilities.
10
10
-**Stamp a row's `timestamp` at COMPLETION and keep invocation as `startTime`.** The page mutation stream is on real time, so an invocation-stamped row replays the page from before its own effect. `collector.captureCurrentDom` stamps `performance.timeOrigin`, not the drain clock.
11
+
-**A row that a retried command or an assertion is folded into keeps the earliest start, `foldedStartTime` (`core/folded-start.ts`).** Every JS adapter's replace path applies it (the WebdriverIO service's retry and matcher folds, Nightwatch's and Selenium's `replaceCommand` callers), so the time spent retrying stays on the row; the end and result are the latest poll's. A WebdriverIO `expect` row starts when its matcher began (`beforeAssertion`).
11
12
-**Live mode drains the collector after any command that could move the page.** Not only at navigation: the nav hook is deferred behind injection and a settle. Selenium's drain is serialized on a tail because the driver patcher does not await `onCommand`; an overtaken batch strands every later row.
12
13
-**`reattributeDomAnchors` (`packages/trace/src/trace-mutations.ts`) only pulls an anchor born after the last logged command, and only when no later command completed.** Pulling anchors earlier otherwise steals the new page's DOM from rows still on the old one. It is also never pulled earlier than the newest timestamp already in the stream (`floor`).
13
14
-**Every per-action snapshot probe is timeout-guarded** (`core/action-snapshot.ts``probe`; the timeout constant is `SNAPSHOT_DRIVER_PROBE_TIMEOUT_MS` in `core/with-timeout.ts`). Nightwatch's `browser.getCurrentUrl()`/`getTitle()` are queued and hang inside the command hook.
/** The start of a row that a retried command or an assertion is folded into: the earliest start either one knew, so the time spent retrying stays on the row. */
2
+
exportfunctionfoldedStartTime(
3
+
first: number|undefined,
4
+
latest: number|undefined
5
+
): number|undefined{
6
+
if(first===undefined){
7
+
returnlatest
8
+
}
9
+
returnlatest===undefined ? first : Math.min(first,latest)
0 commit comments