Skip to content

Commit

Permalink
Adjust tests for Travis CI build.
Browse files Browse the repository at this point in the history
Adjusted `t/sdk/proxy.t.js` for Linux. On Darwin the server process
exits successful, while on Linux the exit is null and the signal is
reported.

Updated the `stdout` listener to fire only once. It was firing twice on
Travis CI, causing the test to setup a second proxy which failed because
the ports were already bound.
  • Loading branch information
flatheadmill committed Mar 6, 2013
1 parent 76b986c commit db5a1b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/sdk/proxy.t.js
Expand Up @@ -6,7 +6,7 @@ require('./proof')(3, function (step, say, ok, equal, execute, proxy) {
var other = step();
server.on('error', function (error) { throw error });
server.stderr.pipe(process.stderr);
server.stdout.on('data', function (chunk) {
server.stdout.once('data', function (chunk) {
proxy(9293, 9593, 9000, function (buffer) { return buffer });
client = execute('integer/client', [ '127.0.0.1', 9293 ]);
client.stderr.pipe(process.stderr);
Expand All @@ -18,7 +18,8 @@ require('./proof')(3, function (step, say, ok, equal, execute, proxy) {
});
});
server.on('close', function (code, signal) {
equal(code, 0, 'server closed');
if (code != null) equal(code, 0, 'server closed');
else equal(signal, 'SIGTERM', 'server closed');
callback(null);
});
});

0 comments on commit db5a1b9

Please sign in to comment.