CodeceptJS
CodeceptJS copied to clipboard
retryTo leads to stale process on failure
I'm sorry @kobenguyent, but we must have missed a regression with the last fix here https://github.com/codeceptjs/CodeceptJS/issues/4110
It works fine as long as assertions are a success, but as soon as there is a failure – even outside the retryTo block – the test never terminates.
Simple test code:
Feature('foo');
Scenario('test issue', async ({ I }) => {
I.amOnPage('http://example.org')
I.waitForVisible('.nothing', 1); // should fail here but it won't terminate
await retryTo( (tryNum) => {
I.see(".doesNotMatter");
}, 10);
});
EDIT: Adding an irregular await before the failing assertion await I.waitForVisible('.nothing', 1)
will let the promise chain resolve.
This issue is stale because it has been open for 90 days with no activity.
The issue still persists (see test case). Unfortunately, retryTo
can not be used currently. FYI @DavertMik
hey @cjhille I reverted those fixes at https://github.com/codeceptjs/CodeceptJS/pull/4117/files#diff-3799cca2cab187279c2a50bbd0c3a7451b24e20da2bdad08d42eb95444d392baR92 but the issue still persists, so I think it's coming from somewhere else.
per my initial thinking, I guess the issue is from waitForVisible
@kobenguyent after investigation, we have found that the issue is not about retryTo
but occurs when a promise reject.
This is enough to stale the process
Scenario('Rejected promise stale the process', async ({ I }) => {
await new Promise((resolve, reject) => setTimeout(reject, 500));
})
We investigate how to solve this