Repository navigation
fix(step): measure step.duration from the first retry attempt (#5774) - #5775
Merged
DenysKuchma merged 2 commits intoOct 30, 2026
Merged
Conversation
…ptjs#5774) HelperStep.run() and FuncStep.run() overwrote startTime on every attempt, so a retried step reported only the duration of its last attempt. Keep the start time of the first attempt, as recordStep() already intends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global recorder.retry() rule stayed registered after the test and retried errors in later test files (AsyncWrapper tests failed in CI). step.retry() removes its rule once the step finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Look nice, thank you |
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.
Fixes #5774
Problem
When a step is retried (e.g. by
retryFailedStep),step.durationcovers only the last attempt.recordStep()keeps the start time of the first attempt, butHelperStep.run()andFuncStep.run()overwrotestartTimeon every attempt. A step retried for ~50 s was reported as 3 ms.Changes
lib/step/helper.js,lib/step/func.js: setstartTimeinrun()only when it isn't already set.Side effect
The global test timeout (
lib/listener/globalTimeout.js) now counts time spent on retry attempts:step.durationis subtracted from the remaining test timeout. Previously only the last attempt was subtracted, so a test with retried steps could run well past its configured timeout. Now such a test fails withTestTimeoutErroronce retries use up the timeout.Date.now() - step.startTimecheck that chooses betweenTestTimeoutErrorandStepTimeoutErroralso includes earlier attempts.Tests
test/unit/steps_test.js:StepandFuncStepkeep the first attempt's start time when run again.test/unit/actor_test.js: a step that fails twice and is retried with a 100 ms delay reportsstep.duration≥ 190 ms inevent.step.finished.🤖 Generated with Claude Code