-
Notifications
You must be signed in to change notification settings - Fork 19
Timers and tests #27
Comments
Idea for allowing timers from CLI but not in CI: Maybe a |
What about specifying test timeouts based on a "reference system" and applying different multipliers on each platform. CI needs not be an exception. |
The problem is that these things are bugs/anti-patterns, and not features. Getting them out of CI is what we're aiming for. It's not a grudging compromise to give up a desirable feature.
|
For reference, one test that uses a code-based timeout is Here's a failure on a very slow RPi1 because of this: https://ci.nodejs.org/job/node-test-binary-arm/1468/RUN_SUBSET=3,nodes=pi1-raspbian-wheezy/tapTestReport/test.tap-97/ |
I should have stated that I am in full agreement with this statement:
So I was thinking of the 60 second timeout that is now used in CI to determine that a test is hanging. If I understood correctly, devs would like that timeout to be shorter when running tests on their machine. What is the right value of that timeout? Maybe 10 seconds? But for tests that take a bit longer to complete, what's the way to declare an exception to the default? |
I think it's more like this: There's a bunch of tests where there is code like this:
...where Sometimes, we go to remove these things, and it sails through. Sometimes we go to remove them and someone states the opinion that if you run the test at the command line (without the In cases like that, it would be nice to have some pre-baked function loaded from
|
I totally agree.
I wouldn't have said it better.
Has this response been that common? I don't remember anyone complaining about it (probably I have missed those comments). It seems to me that lately the PR's that remove the timers have been accepted with little (no) resistance. I think that, for the reasons that @Trott enumerated, we should consider that, in addition to recommending against the use of timers (and probably its removal too), not to implement any special mechanism to force a special timeout behavior. If somebody wants to run the tests with a specific timeout there's Just my 2 cents. |
Honestly, no. I've perhaps provided too much weight to a single instance. |
Correct, the others are guaranteed to fire in pretty much any case. |
Closing as this WG is defunct and this issue has been dormant for a year. Feel free to comment (or, if GitHub allows, re-open) if you think it should stay open. |
What should be the general things we want to happen with timers in tests?
setTimeout()
,setImmediate()
, andprocess.nextTick()
? I think onlysetTimeout()
is generally problematic. The other two are usually fine.sequential
and not inparallel
.What else?
The text was updated successfully, but these errors were encountered: