118: Patch test-cluster-http-pipe.js

Reviewed-by:asquare
This commit is contained in:
Kinsley Wong 2013-12-17 11:43:36 -08:00
parent 10c9bba482
commit e6bc2328b6
4 changed files with 20 additions and 1 deletions

View File

@ -282,6 +282,7 @@
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-buffer.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-chdir.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-child-process-fork-exec-argv.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-cluster-http-pipe.js.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-address.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-ref.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-udp4.js"/>
@ -361,6 +362,7 @@
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-buffer.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-chdir.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-child-process-fork-exec-argv.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-cluster-http-pipe.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-dgram-address.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-dgram-ref.js"/>
<apply-patch-file target="${test.dir}/simple" dir="test/simple" name="test-dgram-udp4.js"/>

View File

@ -0,0 +1,16 @@
--- ../nodejs/test/simple/test-cluster-http-pipe.js 2013-12-17 11:28:18.666118948 -0800
+++ test/simple/test-cluster-http-pipe.js 2013-12-17 11:38:54.817131582 -0800
@@ -40,6 +40,13 @@
process.exit();
});
process.on('exit', function() {
+ // We need to remove the pipe after the test exits
+ // because it causes an EADDRINUSE error when other test try to use the same pipe.
+ var fs = require('fs');
+ var exists = fs.existsSync(common.PIPE);
+ if (exists) {
+ fs.unlinkSync(common.PIPE);
+ }
assert(ok);
});
return;

View File

@ -137,6 +137,7 @@ source.test.simple.list = \
test-cluster-master-kill.js \
test-cluster-message.js \
test-cluster-net-listen.js \
test-cluster-net-send.js \
test-cluster-setup-master.js \
test-cluster-uncaught-exception.js \
test-cluster-worker-death.js \

View File

@ -86,7 +86,7 @@
return new PipeHandle(loop, handle, true);
}
}, avatarContext, LibUVPermission.HANDLE);
var p = new Pipe(pipeHandle);
var p = new Pipe(true, pipeHandle);
that.onread(data, 0, data.length, p);
} else if (type == UV_TCP) {
var socket = AccessController.doPrivileged(new PrivilegedAction() {