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
Bug: retryOnFailedStep works only for the first test in the same run #5598
Feature("github testing")Scenario("test",async({ I })=>{awaitI.amOnPage('https://github.com');awaitI.click('thistextdoesnotexist');})Scenario("test2",async({ I })=>{awaitI.amOnPage('https://github.com');awaitI.click('thistextdoesnotexisttoo');})
and I enabled the retryFailedStep plugin (this is the only plugin, also using playwright helper)
I noticed that the plugin doesn't retry the click step in test2
I patched two functions in the plugin (codeceptjs v4.0.3):
99constwhen=err=>{100if(!enableRetry)return101if(store.debugMode)returnfalse102console.log("store.autoRetries",store.autoRetries);// <-- this is new103if(!store.autoRetries)returnfalse104if(err&&err.isTerminal)returnfalse105if(err&&err.message&&(err.message.includes('ERR_ABORTED')||err.message.includes('frame was detached')||err.message.includes('Target page, context or browser has been closed')))returnfalse106returntrue107}
and
140if(scenarioRetries>0&&config.deferToScenarioRetries!==false){141store.autoRetries=false142return143}144145consthasManualRetries=recorder.retries.some(retry=>retry!==config)// in the second test, recorder.retries.length === 3146console.log("hasManualRetries",hasManualRetries);// <-- this is new147if(hasManualRetries){148store.autoRetries=false149return150}151
I ran it and this is the output:
github testing --
hasManualRetries false
store.autoRetries true
store.autoRetries true
store.autoRetries true
store.autoRetries true
✖ test in 7886ms
hasManualRetries true
store.autoRetries false
store.autoRetries false
✖ test2 in 5760ms
@kobenguyent what is the purpose of the hasManualRetries variable?
I saw that lib/helper/Playwright.js adds another retry which makes this variable be true.
also it looks like there is a leak in recorder.retries over time (I added the isFromLibHelperPlaywright):
The reset of the retries array was commented out here: #3768
I understand the reason for commenting it out.
I think that each plugin/helper should be responsible of managing its own retries configuration by adding and removing it from the recorder.retries array.
Activity
kobenguyent commentedon Jun 3, 2026
@smalia2001 could you try this locally if this resolves your issue? #5601
smalia2001 commentedon Jun 3, 2026
@kobenguyent Thank you for the quick response!
I tried it, but it didn’t work - I’m still getting the same output.
I also tried to see what happens if the first test passes - the bug remains.
smalia2001 commentedon Jun 5, 2026
@kobenguyent what is the purpose of the
hasManualRetriesvariable?I saw that
lib/helper/Playwright.jsadds another retry which makes this variable betrue.also it looks like there is a leak in
recorder.retriesover time (I added theisFromLibHelperPlaywright):kobenguyent commentedon Jun 5, 2026
maybe @DavertMik could explain this better than myself.
smalia2001 commentedon Jun 5, 2026
The reset of the retries array was commented out here: #3768
I understand the reason for commenting it out.
I think that each plugin/helper should be responsible of managing its own retries configuration by adding and removing it from the
recorder.retriesarray.github-actions commentedon Sep 4, 2026
This issue is stale because it has been open for 90 days with no activity.