0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/sequential
Rich Trott 4bdf494d63 test: fix timers-same-timeout-wrong-list-deleted
test-timers-same-timeout-wrong-list-deleted was flaky under load because
there is no guarantee that a timer will fire within a given period of
time. It had an exit handler that checked that the process was finishing
in less than twice as much as a timer was set for. Under load, the
timer could take over 200ms to fire even if it was set for 100ms, so
this was causing the test to be flaky on CI from time to time.

However, that timing check is unnecessary to identify the regression
that the test was written for. When run with a version of Node.js that
does not contain the fix that accompanied the test in its initial
commit, an assertion indicating that there were still timers in the
active timer list fired. So, this commit removes the exit handler timing
check and relies on the existing robust active timers list length check.

This allows us to move the test back to parallel because it does not
seem to fail under load anymore.

The test was refactored slightly, removing duplicated code to a
function, using `assert.strictEqual()` instead of `assert.equal()`,
changing a 10ms timer to 1ms, and improving the messages provided by
assertions.

Fixes: https://github.com/nodejs/node/issues/8459
PR-URL: https://github.com/nodejs/node/pull/10362
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-22 16:40:09 -08:00
..
sequential.status Revert "crypto: add crypto.timingSafeEqual" 2016-08-23 10:52:32 -07:00
test-buffer-creation-regression.js test: move long-running test to sequential 2016-12-07 07:35:29 -08:00
test-child-process-emfile.js tools: add eslint rule prefer-assert-methods 2016-09-20 16:35:39 -07:00
test-child-process-execsync.js child_process: remove extra newline in errors 2016-11-02 19:25:32 -04:00
test-child-process-fork-getconnections.js tools: add eslint rule prefer-assert-methods 2016-09-20 16:35:39 -07:00
test-child-process-pass-fd.js test: prevent workers outliving parent 2016-10-27 09:49:06 -07:00
test-crypto-timing-safe-equal.js test: refactor test-crypto-timing-safe-equal 2016-12-01 18:40:33 +01:00
test-debug-host-port.js src: make debugger listen on 127.0.0.1 by default 2016-08-23 21:10:34 +02:00
test-debugger-debug-brk.js test: move test-debugger-debug-brk to sequential 2016-05-16 13:38:31 -07:00
test-deprecation-flags.js Revert "repl,util: insert carriage returns in output" 2016-08-19 11:48:52 -05:00
test-dgram-pingpong.js test: fix flaky test-dgram-pingpong 2016-02-07 13:01:05 -08:00
test-fs-watch.js test: fix flaky fs-watch tests 2016-08-18 09:54:43 -07:00
test-http-client-timeout-with-data.js test: fix freebsd10-64 CI failures 2016-10-29 13:11:01 -07:00
test-http-regr-gh-2928.js test: retry on known SmartOS bug 2016-03-01 13:35:48 -08:00
test-http-server-consumed-timeout.js test: fix freebsd10-64 CI failures 2016-10-29 13:11:01 -07:00
test-init.js test: make import common as the first line 2016-07-21 16:39:21 -07:00
test-module-loading.js test: invalid package.json causes error when require()ing in directory 2016-12-07 10:00:11 -05:00
test-net-GH-5504.js test: fix flaky test-net-GH-5504 2016-11-06 09:22:10 +01:00
test-net-server-address.js test: cleanup test-net-server-address.js 2016-09-29 10:37:54 +03:00
test-next-tick-error-spin.js test: refactor test-next-tick-error-spin 2016-11-12 10:37:54 -08:00
test-pipe.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
test-process-warnings.js tools: add additional ESLint rules 2016-09-20 23:21:10 -04:00
test-regress-GH-784.js lib,test: fix whitespace issues 2015-06-15 16:37:37 +02:00
test-regress-GH-877.js test: use strict equality in regression test 2016-08-16 20:51:39 -07:00
test-regress-GH-897.js test: move timer-dependent test to sequential 2016-11-09 16:46:16 -08:00
test-regress-GH-1697.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
test-regress-GH-1726.js test: remove unnecessary assignments 2015-12-26 18:00:02 -08:00
test-regress-GH-4015.js test: enable linting for tests 2015-05-19 21:21:27 +02:00
test-regress-GH-4027.js test: use mustCall() for simple flow tracking 2016-07-18 17:14:16 -04:00
test-repl-timeout-throw.js test: move timer-dependent test to sequential 2016-11-04 21:32:10 -07:00
test-require-cache-without-stat.js test: fix redeclared vars in sequential tests 2016-02-02 20:19:10 +01:00
test-stream2-fs.js test,benchmark: use deepStrictEqual() 2016-04-22 14:38:09 -07:00
test-stream2-stderr-sync.js test: remove unused assert module imports 2015-12-30 11:45:34 -08:00
test-timers-blocking-callback.js test: fix freebsd10-64 CI failures 2016-10-29 13:11:01 -07:00
test-util-debug.js test: use mustCall() for simple flow tracking 2016-07-18 17:14:16 -04:00
test-vm-timeout-rethrow.js lib,test,tools: alignment on variable assignments 2016-04-18 17:19:11 -07:00
testcfg.py test: split test in parallel/sequential 2014-12-17 20:45:02 +07:00