Skip to content

Commit

Permalink
Fix handshake timeout for Travis node v0.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed May 30, 2012
1 parent fff2738 commit 75e0fac
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/integration/test-send-and-receive-large-packets.js
Expand Up @@ -7,13 +7,21 @@ var buffer = new Buffer(length);
var sql = 'SELECT ? as bigField';

var rows = [];
connection.query(sql, [buffer], function(err, _rows) {

// Nesting the query inside the connect() method because our buffer to hex shim
// for node v0.4.x takes ~12sec on TravisCI causing a handshake timeout unless
// we do the handshake first before creating the SQL query.
connection.connect(function(err) {
if (err) throw err;

rows = _rows;
});
connection.query(sql, [buffer], function(err, _rows) {
if (err) throw err;

connection.end();
rows = _rows;
});

connection.end();
});

process.on('exit', function() {
assert.equal(rows.length, 1);
Expand Down

0 comments on commit 75e0fac

Please sign in to comment.