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

Review the last standing callback #11

Open
relu91 opened this issue Aug 26, 2022 · 2 comments
Open

Review the last standing callback #11

relu91 opened this issue Aug 26, 2022 · 2 comments
Labels

Comments

@relu91
Copy link
Contributor

relu91 commented Aug 26, 2022

That is needed for some tests, I'm not sure I should remove it.
In detail, if we are in a test that is using that worker, the test will set a callback used instead of the function this.err which will cause the process.exit(1);.

Originally posted by @FerrariAndrea in #8 (comment)

We have to discuss why is still needed for the tests and try to remove it if it makes sense

@relu91 relu91 added priority: medium (3) Medium-priority issue that needs to be resolved effort: hours type: code style type: refactor labels Aug 26, 2022
@FerrariAndrea
Copy link
Contributor

FerrariAndrea commented Aug 26, 2022

In order to achieve a good coverage percentage of Jest, I need to test some cases that in the "production" behavior will call the process.exit(1) That is a good practice for the Iexec Oracle app, because this should help the workerpool to know if the running is finished before the time-out (we know that in the actual state of the Iexec platform that doesn't seem to happen anyway).

If during the test I run the process.exit(1) that will kill the entire test queue.
Using jest there is a way to handle that?
Maybe we can try that after the test-refactoring #7

@relu91
Copy link
Contributor Author

relu91 commented Aug 26, 2022

If during the test I run the process.exit(1) that will kill the entire test queue.
Using jest there is a way to handle that?

Of course there is:
https://stackoverflow.com/questions/46148169/stubbing-process-exit-with-jest

Maybe we can try that after the test-refactoring #7

Yes let's solve this in #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants