From 8cf2d4c2c16481020bc6e670c1f6596b77150634 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 8 Mar 2013 09:10:57 -0800 Subject: [PATCH] test: Don't run async operation in process 'exit' Also, this seems to occasionally cause some annoying file-locking errors in Windows. Not sure if this is the best fix, but it seems to make the warnings go away in that spot. --- test/simple/test-http-curl-chunk-problem.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/simple/test-http-curl-chunk-problem.js b/test/simple/test-http-curl-chunk-problem.js index 908b0dd57c..5b1cb0beb2 100644 --- a/test/simple/test-http-curl-chunk-problem.js +++ b/test/simple/test-http-curl-chunk-problem.js @@ -31,14 +31,7 @@ var http = require('http'); var cp = require('child_process'); var fs = require('fs'); -var filename = require('path').join(common.tmpDir || '/tmp', 'big'); - -// Clean up after ourselves. Leaving files around -// in the tmp/ directory may break tests that depend -// on a certain number of files being there. -process.on('exit', function() { - fs.unlink(filename); -}); +var filename = require('path').join(common.tmpDir, 'big'); var count = 0; function maybeMakeRequest() { @@ -50,6 +43,7 @@ function maybeMakeRequest() { var hex = stdout.match(/([A-Fa-f0-9]{40})/)[0]; assert.equal('8c206a1a87599f532ce68675536f0b1546900d7a', hex); console.log('got the correct response'); + fs.unlink(filename); server.close(); }); }