Skip to content

Commit 7a5ae34

Browse files
Trottjasnell
authored andcommitted
test: refresh temp directory when using pipe
common.PIPE resides in the temp directory (except on Windows). Insure that the temp directory is refreshed in tests that use common.PIPE. PR-URL: #3231 Fixes: #3227 Reviewed-By: Johan Bergström <[email protected]>
1 parent 40a159e commit 7a5ae34

12 files changed

+19
-4
lines changed

test/parallel/test-async-wrap-check-providers.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ new (process.binding('tty_wrap').TTY)();
4747

4848
crypto.randomBytes(1, noop);
4949

50-
try {
51-
fs.unlinkSync(common.PIPE);
52-
} catch(e) { }
50+
common.refreshTmpDir();
5351

5452
net.createServer(function(c) {
5553
c.end();

test/parallel/test-cluster-eaccess.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if (cluster.isMaster) {
3636
});
3737

3838
} else {
39+
common.refreshTmpDir();
3940
var cp = fork(common.fixturesDir + '/listen-on-socket-and-exit.js',
4041
{ stdio: 'inherit' });
4142

test/parallel/test-http-client-pipe-end.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ var server = http.createServer(function(req, res) {
1414
});
1515
});
1616

17+
common.refreshTmpDir();
18+
1719
server.listen(common.PIPE, function() {
1820
var req = http.request({
1921
socketPath: common.PIPE,

test/parallel/test-http-client-response-domain.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ process.on('exit', function() {
1111
assert(gotDomainError);
1212
});
1313

14+
common.refreshTmpDir();
15+
1416
// first fire up a simple HTTP server
1517
var server = http.createServer(function(req, res) {
1618
res.writeHead(200);

test/parallel/test-http-unix-socket.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ var server = http.createServer(function(req, res) {
1818
res.end();
1919
});
2020

21+
common.refreshTmpDir();
22+
2123
server.listen(common.PIPE, function() {
2224

2325
var options = {

test/parallel/test-net-pingpong.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function pingPongTest(port, host) {
106106
}
107107

108108
/* All are run at once, so run on different ports */
109-
console.log(common.PIPE);
109+
common.refreshTmpDir();
110110
pingPongTest(common.PIPE);
111111
pingPongTest(common.PORT);
112112
pingPongTest(common.PORT + 1, 'localhost');

test/parallel/test-net-pipe-connect-errors.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (common.isWindows) {
2121
} else {
2222
// use common.PIPE to ensure we stay within POSIX socket path length
2323
// restrictions, even on CI
24+
common.refreshTmpDir();
2425
emptyTxt = common.PIPE + '.txt';
2526

2627
function cleanup() {

test/parallel/test-repl.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var common = require('../common');
33
var assert = require('assert');
44

55
common.globalCheck = false;
6+
common.refreshTmpDir();
67

78
var net = require('net'),
89
repl = require('repl'),

test/parallel/test-tls-connect-pipe.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ var options = {
1818
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
1919
};
2020

21+
common.refreshTmpDir();
22+
2123
var server = tls.Server(options, function(socket) {
2224
++serverConnected;
2325
server.close();

test/sequential/test-pipe-address.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var server = net.createServer(function() {
99
assert(false); // should not be called
1010
});
1111

12+
common.refreshTmpDir();
13+
1214
server.listen(common.PIPE, function() {
1315
address = server.address();
1416
server.close();

test/sequential/test-pipe-stream.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ var common = require('../common');
33
var assert = require('assert');
44
var net = require('net');
55

6+
common.refreshTmpDir();
7+
68
function test(clazz, cb) {
79
var have_ping = false;
810
var have_pong = false;

test/sequential/test-pipe-unref.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var assert = require('assert');
55
var net = require('net');
66
var closed = false;
77

8+
common.refreshTmpDir();
9+
810
var s = net.Server();
911
s.listen(common.PIPE);
1012
s.unref();

0 commit comments

Comments
 (0)