🐛 Bug: --timeout 0
does not disable timeouts
#4834
Labels
status: accepting prs
Mocha can use your help with this one!
type: bug
a defect, confirmed by a maintainer
Prerequisites
faq
labelnode_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
I ran a mocha test using IntelliJ's debugger, which automatically sets
--timeout 0
. Left it paused for several minutes while looking at something, and when I resumed it, it timed out.Steps to Reproduce
this.timeout(T)
(I haven't tried with the timeout() call inside the it(), not sure if behaviour changes)it()
will take longer thanT
to run: set a breakpoint, or add code that will take longer than that--timeout 0
Working example
cd newversion
npm install
npm run test
There's also an
oldversion
folder which contains the same test script, but the package.json is set to use mocha@7.2.1, which is the last version where this issue doesn't occur. I checked with v8.0.0 and the issue occurs.Expected behavior: No matter how long the test takes, it will not time out if run with
--timeout 0
Actual behavior: The test times out after
T
millisecondsReproduces how often: 100%
Versions
mocha --version
andnode_modules/.bin/mocha --version
: No global install. Issue reproduced on v8.0.0 and v9.2.1. Issue does not occur on v7.2.1.node --version
: v14.9.0The text was updated successfully, but these errors were encountered: