-
-
Notifications
You must be signed in to change notification settings - Fork 741
Fixed running retryFailedStep inside tryTo #4831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
checks.setup = true | ||
for (const helper of Object.values(helpers)) { | ||
try { | ||
if (helper._beforeSuite) await helper._beforeSuite(suite) | ||
if (helper._before) await helper._before(test) | ||
} catch (err) { | ||
err.message = `${helper.constructor.name} helper: ${err.message}` | ||
if (checks.setup instanceof Error) err.message = `${err.message}\n\n${checks.setup?.message || ''}`.trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, the line 135 defines as a boolean
and then line 143 we assign an Error
to it.
Shall we assign err.message
to checks.setup?.message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
the value of setup is boolean|| Error
if it is error, we pick a previous message and append to current error
if it is true but we fail, we write error
if it is true and never fail we have true
See line 170
} catch (err) { | ||
err.message = `${helper.constructor.name} helper: ${err.message}` | ||
if (checks.teardown instanceof Error) err.message = `${err.message}\n\n${checks.teardown?.message || ''}`.trim() | ||
checks.teardown = err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above concern
lib/effects.js
Outdated
return recorder.add( | ||
sessionName, | ||
() => { | ||
recorder.session.start(sessionName) | ||
store.tryTo = true | ||
hasAutoRetriesEnabled = store.autoRetries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about isAutoRetriesEnabled
?
@@ -484,7 +484,7 @@ class Playwright extends Helper { | |||
this.currentRunningTest = test | |||
|
|||
recorder.retry({ | |||
retries: process.env.FAILED_STEP_RETRIES || 3, | |||
retries: test?.opts?.conditionalRetries || 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you touched this, what do you think if we store default retries = 3 in Store
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we need a better name for it...
this handles a very strange edge cases in Playwright / Puppeteer
I don't know what name in store is applicable for this and in which other contexts can be used
} else { | ||
args.push(JSON.stringify(arg).slice(0, 300)) | ||
} else if (arg) { | ||
args.push((JSON.stringify(arg) || '').slice(0, 300)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any chance JSON.stringify(arg)
is null
or undefined
then '' is used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not print undefined here...
Not sure about null
But I'd rather not, it's not readable...
Fixed regression when retryFailedStep was enabled inside tryTo block
Other changes
check
messages