Browse Source

Avoid cascading EADDRINUSE test failure

See note in test-securepair-client.js
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
85827bde34
  1. 10
      test/simple/test-securepair-client.js

10
test/simple/test-securepair-client.js

@ -6,6 +6,12 @@ var fs = require('fs');
var crypto = require('crypto'); var crypto = require('crypto');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
// FIXME: Avoid the common PORT as this test currently hits a C-level
// assertion error with node_g. The program aborts without HUPing
// the openssl s_server thus causing many tests to fail with
// EADDRINUSE.
var PORT = common.PORT + 5;
var connections = 0; var connections = 0;
var keyfn = join(common.fixturesDir, "agent.key"); var keyfn = join(common.fixturesDir, "agent.key");
@ -15,7 +21,7 @@ var certfn = join(common.fixturesDir, "agent.crt");
var cert = fs.readFileSync(certfn).toString(); var cert = fs.readFileSync(certfn).toString();
var server = spawn('openssl', ['s_server', var server = spawn('openssl', ['s_server',
'-accept', common.PORT, '-accept', PORT,
'-cert', certfn, '-cert', certfn,
'-key', keyfn]); '-key', keyfn]);
server.stdout.pipe(process.stdout); server.stdout.pipe(process.stdout);
@ -77,7 +83,7 @@ function startClient () {
pair.encrypted.pipe(s); pair.encrypted.pipe(s);
s.pipe(pair.encrypted); s.pipe(pair.encrypted);
s.connect(common.PORT); s.connect(PORT);
s.on('connect', function () { s.on('connect', function () {
console.log("client connected"); console.log("client connected");

Loading…
Cancel
Save