Skip to content
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

fix: handle throw error inside retryTo promise #4377

Merged
merged 12 commits into from
Jun 7, 2024

Conversation

Horsty80
Copy link
Contributor

@Horsty80 Horsty80 commented Jun 4, 2024

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
Copy link
Contributor Author

Horsty80 commented Jun 4, 2024

@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
Collaborator

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

@Horsty80
Copy link
Contributor Author

Horsty80 commented Jun 5, 2024

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
Copy link
Contributor Author

Horsty80 commented Jun 5, 2024

@kobenguyent TU are fix now :)

@kobenguyent
Copy link
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
Copy link
Contributor Author

Horsty80 commented Jun 5, 2024

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
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
Copy link
Contributor Author

Horsty80 commented Jun 5, 2024

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.

@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
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
13 checks passed
This pull request was closed.
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