Browse Source

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.
v0.10.0-release
isaacs 12 years ago
parent
commit
8cf2d4c2c1
  1. 10
      test/simple/test-http-curl-chunk-problem.js

10
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();
});
}

Loading…
Cancel
Save