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

Timeout configuration is ignored due to a mocha bug #2509

Closed
ian-speers opened this issue Jul 29, 2020 · 3 comments
Closed

Timeout configuration is ignored due to a mocha bug #2509

ian-speers opened this issue Jul 29, 2020 · 3 comments

Comments

@ian-speers
Copy link

What are you trying to achieve?

I'm trying to configure timeouts but they are being ignored.

What do you get instead?

I would like configured timeouts to be respected.

Details

There are a few places in the code where [Runnable].timeout(0) is being called (here, here, here, etc.). There was a bug in Runnable.timeout prior to mocha v8.0.1 which caused timeouts to remain permanently disabled after being set to zero. Would it be possible to upgrade mocha, or to change all occurrences of [Runnable].timeout(0) to [Runnable].timeout(Number.MAX_SAFE_INTEGER)? I'd be glad to handle the latter, but upgrading mocha caused a bunch of tests to fail and I don't have time to resolve those at the moment. Let me know—thanks!

@Vorobeyko
Copy link
Collaborator

Hi @ian-speers. We are works on this bug on #2464

@ian-speers
Copy link
Author

Thanks @Vorobeyko! I see that's tagged for the 3.0 release. In the meantime, would you be open to a PR that fixes this as described above? If not—do you have an ETA for that release?

@ian-speers
Copy link
Author

For anyone else facing this issue, I added a postinstall hook to my project to patch the broken behavior.

"postinstall": "grep -rlF '.timeout(0)' node_modules/codeceptjs/lib | xargs sed -i.bak 's/.timeout(0)/.timeout(Number.MAX_SAFE_INTEGER)/g'"

Looking forward to the 3.0 release so I can remove this 😁

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

No branches or pull requests

3 participants