test: fix test-tcp-wrap-listen
authorAlexis Campailla <alexis@janeasystems.com>
Tue, 4 Feb 2014 17:16:44 +0000 (09:16 -0800)
committerFedor Indutny <fedor.indutny@gmail.com>
Tue, 4 Feb 2014 18:51:11 +0000 (22:51 +0400)
If the call to writeBuffer completes asynchronously, we need to have
an oncomplete callback on the request object no matter what. The
writeQueueSize seems irrelvant to that regard.

Note that on Windows writeBuffer always completes asynchronously.

See related commit 9836a4eeda1e2d43aad0923f1f72b364792629bc

test/simple/test-tcp-wrap-listen.js

index 940ea8b..fb3175a 100644 (file)
@@ -64,7 +64,7 @@ server.onconnection = function(err, client) {
       // 11 bytes should flush
       assert.equal(0, client.writeQueueSize);
 
-      if (req.async && client.writeQueueSize != 0)
+      if (req.async)
         req.oncomplete = done;
       else
         process.nextTick(done.bind(null, 0, client, req));