diff --git a/test/simple/test-http-destroyed-socket-write2.js b/test/simple/test-http-destroyed-socket-write2.js index 3347f3ccc9..ebb80c9a25 100644 --- a/test/simple/test-http-destroyed-socket-write2.js +++ b/test/simple/test-http-destroyed-socket-write2.js @@ -49,8 +49,9 @@ server.listen(common.PORT, function() { req.end(); test(); } else { - timer = setImmediate(write); - req.write('hello'); + req.write('hello', function() { + timer = setImmediate(write); + }); } }