Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure scenario termination #4378

Merged

Conversation

Horsty80
Copy link
Contributor

@Horsty80 Horsty80 commented Jun 5, 2024

Motivation/Description of the PR

Also, we have updated done() to prevent it from being called more than once inside Scenario.
Possibly the root of this kind of error.
Error: done() called multiple times in

Applicable helpers:

  • Playwright

Type of change

  • 🐛 Bug fix
  • 🧹 Chore
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Local tests are passed (Run npm test)
Capture d’écran 2024-06-05 à 16 44 50

@Horsty80
Copy link
Contributor Author

Horsty80 commented Jun 5, 2024

Hey @kobenguyent I've find and fix that cause the issue #4197 that you talk about here
#4377 (comment)

I have added the test case here and it's ok

https://github.com/codeceptjs/CodeceptJS/pull/4378/files#diff-1d3c534eda54e8e8ac941eb8fcce76dad6eb240a5def22158aea06cf097a5135R20

@@ -113,6 +113,9 @@ module.exports = function (config) {

recorder.add('retryTo', async () => {
tryBlock();
}).catch(err => {
console.error('An error occurred:', err);
done(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if done() should be enough?

Copy link
Contributor Author

@Horsty80 Horsty80 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test case that i added passed with the resolve promise so i guess it's enough ^^

Just retryTo will be update with my other pr, so when the first it's merge, i will update this file
I think it's a good practice to add the catch block when we add something to the recorder i presume

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I meant done() instead of done(null)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I meant done() instead of done(null)

The done is the resolve of the promise and I get this type

Capture d’écran 2024-06-07 à 10 13 01

and in the file, done function already call with done(null) 🤷‍♂️

lib/scenario.js Outdated Show resolved Hide resolved
test/runner/scenario_stale_test.js Outdated Show resolved Hide resolved
@kobenguyent kobenguyent changed the base branch from 3.x to fix/stale-process June 7, 2024 07:09
@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
Copy link
Collaborator

hi @Horsty80 would you mind checking the failed tests? I changed the base branch there are some conflicts, I tried to resolve them but some failed tests.

@Horsty80
Copy link
Contributor Author

Horsty80 commented Jun 7, 2024

hi @Horsty80 would you mind checking the failed tests? I changed the base branch there are some conflicts, I tried to resolve them but some failed tests.

Yes of course ! I know that will be conflict with my other PR ^^
I will fix that and push changes today

@kobenguyent kobenguyent merged commit 7177179 into codeceptjs:fix/stale-process Jun 7, 2024
13 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Asking for help] Process are blocking when throw error in scenario with Retry enabled
3 participants