mirror of https://github.com/nodejs/node.git
Clean up temporary file on exit.
Unbreaks test/simple/test-http-get-pipeline-problem.js, it assumed a fixed number of files in the tmp directory.pull/22966/head
parent
24a671a8aa
commit
092fc42fbf
test/simple
|
@ -27,12 +27,19 @@ if (!process.versions.openssl) {
|
||||||
// http://groups.google.com/group/nodejs/browse_thread/thread/f66cd3c960406919
|
// http://groups.google.com/group/nodejs/browse_thread/thread/f66cd3c960406919
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var http = require('http'),
|
var http = require('http');
|
||||||
cp = require('child_process');
|
var cp = require('child_process');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
var filename = require('path').join(common.tmpDir || '/tmp', 'big');
|
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 count = 0;
|
var count = 0;
|
||||||
function maybeMakeRequest() {
|
function maybeMakeRequest() {
|
||||||
if (++count < 2) return;
|
if (++count < 2) return;
|
||||||
|
|
Loading…
Reference in New Issue