diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-23 17:14:36 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-23 17:59:10 +0100 |
commit | 4f95b5d8253ef64e3673b9fa178c41dc8109b72b (patch) | |
tree | ef6734614f9bf1a45b33c2c2806506a7618e500e /test/parallel/test-http-destroyed-socket-write2.js | |
parent | 5ba307a97879342ff81aa813ffd7da46b6411b1c (diff) | |
download | android-node-v8-4f95b5d8253ef64e3673b9fa178c41dc8109b72b.tar.gz android-node-v8-4f95b5d8253ef64e3673b9fa178c41dc8109b72b.tar.bz2 android-node-v8-4f95b5d8253ef64e3673b9fa178c41dc8109b72b.zip |
test: fix parallel/test-http-destroyed-socket-write2
Ameliorate a timing sensitivity issue by switching from setImmediate()
to setTimeout() with a 50 ms timeout.
This commit also adds EPIPE as an accepted error (besides ECONNABORT
and ECONNRESET) because that's a plausible outcome given the timing
sensitive nature of test.
PR-URL: https://github.com/iojs/io.js/pull/575
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'test/parallel/test-http-destroyed-socket-write2.js')
-rw-r--r-- | test/parallel/test-http-destroyed-socket-write2.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index dc5b129dc8..1552d2c2c1 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -19,7 +19,7 @@ server.listen(common.PORT, function() { method: 'POST' }); - var timer = setImmediate(write); + var timer = setTimeout(write, 50); var writes = 0; function write() { @@ -28,7 +28,7 @@ server.listen(common.PORT, function() { req.end(); test(); } else { - timer = setImmediate(write); + timer = setTimeout(write, 50); req.write('hello'); } } @@ -45,6 +45,9 @@ server.listen(common.PORT, function() { case 'ECONNRESET': // On windows this sometimes manifests as ECONNABORTED case 'ECONNABORTED': + // This test is timing sensitive so an EPIPE is not out of the question. + // It should be infrequent, given the 50 ms timeout, but not impossible. + case 'EPIPE': break; default: assert.strictEqual(er.code, |