fix: prevent retry config accumulation - #5606
Conversation
|
@smalia2001 could be resolve the real issue |
|
@DavertMik done. |
|
@smalia2001 Can we fix the new exec tests so they fail with the real error instead of timing out, and double-check that the new retry accumulation cases pass? Also worth covering retryFailedStep together with Playwright/Puppeteer retries, since this PR touches both |
|
@DenysKuchma I understand your point about playwright and puppeteer, but I don't get you about failing instead of timing out... This tests are failing if the failing step doesn't get retried. |
…leanup their own config after each test - Playwright & Puppeteer: store retry config in this._retryConfig and remove in _after() - retryFailedStep plugin: avoid duplicate pushes and clean config on event.test.after
0b3a5b7 to
23b2bfe
Compare
|
@smalia2001 Your proposed fix works for me. A patch I'm having in my project now is a bit differrent (and works for me too): diff --git a/lib/plugin/retryFailedStep.js b/lib/plugin/retryFailedStep.js
index 394fa4e..bd889f9 100644
--- a/lib/plugin/retryFailedStep.js
+++ b/lib/plugin/retryFailedStep.js
@@ -141,12 +141,6 @@ export default function (config) {
return
}
- const hasManualRetries = recorder.retries.some(retry => retry !== config)
- if (hasManualRetries) {
- store.autoRetries = false
- return
- }
-
store.autoRetries = true
test.opts.conditionalRetries = config.retries
test.opts.stepRetryPriority = stepRetryPriority
@@ -158,9 +152,6 @@ export default function (config) {
event.dispatcher.on(event.test.started, test => {
if (test.opts?.disableRetryFailedStep || test.disableRetryFailedStep) return
- const hasManualRetries = recorder.retries.some(retry => retry !== config)
- if (hasManualRetries) return
-
const scenarioRetries = typeof test.retries === 'function' ? test.retries() : -1
if (scenarioRetries > 0 && config.deferToScenarioRetries !== false) {
return |
@DenysKuchma ?? |
|
@smalia2001 Sorry for the delay. I meant that the new exec tests should pass child process errors to done(err) instead of potentially timing out. Also, please update the branch with the latest 4.x and rerun CI |
Make each plugin/helper clean its own retry configuration
recorder.retriesand makeretryFailedStepplugin keep working also in then > 1test.Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs)npm run lint)npm test)