Skip to content

fix: handle throw error inside retryTo promise - #4377

Merged
kobenguyent merged 12 commits into
codeceptjs:fix/stale-processfrom
Horsty80:fix-retryTo
Jun 7, 2024
Merged

fix: handle throw error inside retryTo promise#4377
kobenguyent merged 12 commits into
codeceptjs:fix/stale-processfrom
Horsty80:fix-retryTo

Conversation

@Horsty80

@Horsty80 Horsty80 commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

Motivation/Description of the PR

Applicable plugins:

  • retryTo

Type of change

  • 🐛 Bug fix

Checklist:

  • Tests have been added
  • Local tests are passed (Run npm test)

@Horsty80

Horsty80 commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

@kobenguyent with a friend, we have work on this, you can find a reproducible unit test that lead to a stale process without our change on retryTo.js

It's seems not terminating promises properly can lead to a stale process.
So maybe a clue to resolve issue #4358

Let me know if this needs some reworks

Thanks

@kobenguyent

Copy link
Copy Markdown
Collaborator

Hey @Horsty80 thanks for the investigation. May you hell check the UTs? Failed tests there. 🤔

@Horsty80

Horsty80 commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

Hey @Horsty80 thanks for the investigation. May you hell check the UTs? Failed tests there. 🤔

I check the why it's failing, on my laptop the npm run test is working and correct that

@Horsty80

Horsty80 commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

@kobenguyent TU are fix now :)

@kobenguyent

Copy link
Copy Markdown
Collaborator

Could you do me a favor please?

Trying your fix with scenario listed here. #4197

If that the case then I don't think my fix is needed or perhaps an extra layer to be sure.

@Horsty80

Horsty80 commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

Could you do me a favor please?

Trying your fix with scenario listed here. #4197

If that the case then I don't think my fix is needed or perhaps an extra layer to be sure.

I've check the scenario

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);
});

And I think is another issue, not on the retryTo
I'm working on fix this to so I will fix it in another PR

I've tested this scenario and the issue (without your fix) is still present.
Sequence I.waitForVisible that failed and after a retryTo lead to stale the process

@kobenguyent

Copy link
Copy Markdown
Collaborator

Could you do me a favor please?
Trying your fix with scenario listed here. #4197
If that the case then I don't think my fix is needed or perhaps an extra layer to be sure.

I've check the scenario

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);
});

And I think is another issue, not on the retryTo I'm working on fix this to so I will fix it in another PR

I've tested this scenario and the issue (without your fix) is still present. Sequence I.waitForVisible that failed and after a retryTo lead to stale the process

Thanks @Horsty80. I guess that aforementioned covered by #4367

@Horsty80

Horsty80 commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

Could you do me a favor please?
Trying your fix with scenario listed here. #4197
If that the case then I don't think my fix is needed or perhaps an extra layer to be sure.

I've check the scenario

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);
});

And I think is another issue, not on the retryTo I'm working on fix this to so I will fix it in another PR
I've tested this scenario and the issue (without your fix) is still present. Sequence I.waitForVisible that failed and after a retryTo lead to stale the process

Thanks @Horsty80. I guess that aforementioned covered by #4367

Indeed maybe your fix cover this case.

@kobenguyent
kobenguyent requested a review from DavertMik June 5, 2024 11:13
@Horsty80 Horsty80 mentioned this pull request Jun 5, 2024
6 tasks
@kobenguyent kobenguyent assigned DavertMik and unassigned DavertMik Jun 6, 2024
@kobenguyent
kobenguyent changed the base branch from 3.x to fix/stale-process June 7, 2024 07:10
@kobenguyent

Copy link
Copy Markdown
Collaborator

as this also addresses the stale process, so I think we would combine them into a branch. Then provide a beta version to test it out.

@kobenguyent
kobenguyent merged commit cbe818a into codeceptjs:fix/stale-process Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants