feat(trace): report requests still pending when an action ran - #42173
Open
John Hill (unlikelyzero) wants to merge 1 commit into
Open
feat(trace): report requests still pending when an action ran#42173John Hill (unlikelyzero) wants to merge 1 commit into
John Hill (unlikelyzero) wants to merge 1 commit into
Conversation
Actions that run while requests are outstanding are the usual cause of flaky
clicks and stale assertions, but the trace CLI could not surface them:
`trace requests` prints durations without start times, so the overlap between
a request and an action was not derivable from its output.
Correlate each action's startTime with the HAR entries' _monotonicTime, both
of which come from the same monotonicTime() source:
trace requests --pending-at <action-id> [--phase start|end]
trace actions --pending [--phase start|end]
`--phase start` answers "did we act too early", `--phase end` answers "did we
move on too early". At the end phase an `Origin` column separates requests
that predated the action ('before' - the page never settled) from ones the
action itself triggered and did not wait for ('during'), which have different
fixes.
A failed or aborted request keeps `harEntry.time` at its -1 default, so its
end is unknown; such requests are counted separately rather than reported as
pending, which would otherwise flag every `route.abort()`ed request against
every later action. Actions that never finished, and configuration actions
that carry no ordinal, are likewise excluded and reported as counts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
trace actions --pendinglists actions that started (or finished, with--phase end) while requests were still outstandingtrace requests --pending-at <action-id> [--phase start|end]lists which requests were pending at that point, and how long each overranFixes #42172