Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

many tests are too slow #4932

Closed
isaacs opened this issue Mar 6, 2013 · 7 comments
Closed

many tests are too slow #4932

isaacs opened this issue Mar 6, 2013 · 7 comments

Comments

@isaacs
Copy link

isaacs commented Mar 6, 2013

There are a lot of tests that are too slow. Some of them do 1000ms timeouts and stuff, but are perfectly fine to run much faster than that, especially when they should be responding to events rather than waiting on a setTimeout. A full second is way too long for anything in test/simple/, since we run that very frequently.

It'd be great to have most tests run in under 50ms, or perhaps as much as 200ms for cases where timing is actually relevant to the test.

I'd suggest that some tests should just be retired, but every time I think that, some ancient test ends up catching a regression, so they should probably all stay.

@isaacs
Copy link
Author

isaacs commented Mar 6, 2013

These tests all take 1s or longer:

$ python tools/test.py -t 1 -p tap simple | grep 'not ok'
not ok 53 - test-cluster-master-kill.js
not ok 54 - test-cluster-message.js
not ok 160 - test-fs-watch.js
not ok 171 - test-http.js
not ok 172 - test-http-1.0.js
not ok 173 - test-http-1.0-keep-alive.js
not ok 213 - test-http-full-response.js
not ok 214 - test-http-get-pipeline-problem.js
not ok 216 - test-http-head-response-has-no-body.js
not ok 227 - test-http-many-keep-alive-connections.js
not ok 282 - test-https-no-reader.js
not ok 317 - test-net-keepalive.js
not ok 354 - test-pipe-file-to-http.js
not ok 383 - test-regress-GH-1697.js
not ok 439 - test-stream-pipe-multi.js
not ok 441 - test-stream2-basic.js
not ok 460 - test-stream2-writable.js

Those would be a good place to start.

@matthewpalmer
Copy link

How do I run a test for a single file individually? Eg. I want to just run the tests in test-fs-watch.js, not all the tests with make test.
Thanks - sorry if this is a silly question.

@bnoordhuis
Copy link
Member

You can run either out/Release/node test/simple/test-fs-watch.js or python tools/test.py simple/test-fs-watch (the latter also accepts wildcards, e.g. simple/test-fs-* runs all the fs tests.)

@matthewpalmer
Copy link

Awesome. Thank you :)

@frankcash
Copy link

Is this still a wanted change? I'd be willing to work on this

@bnoordhuis
Copy link
Member

I think this can be closed. Slow tests have been moved to test/pummel and io.js goes a step further by running most tests in parallel as of nodejs/node#172.

@jasnell
Copy link
Member

jasnell commented May 20, 2015

Marking this as a potential iojs-backport, but closing. Can reopen if we feel this is still something worth pursuing in this stream.

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

No branches or pull requests

5 participants