From 95507dac5f9159f2fc2bf4c37078b175ba03a509 Mon Sep 17 00:00:00 2001 From: bmc Date: Sun, 30 Jun 2013 11:34:02 -0700 Subject: [PATCH 1/3] Enable connection failure error handling tests --- test/integration/client/error-handling-tests.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/integration/client/error-handling-tests.js b/test/integration/client/error-handling-tests.js index 1f02597..ae8a3d1 100644 --- a/test/integration/client/error-handling-tests.js +++ b/test/integration/client/error-handling-tests.js @@ -114,7 +114,6 @@ test('non-error calls supplied callback', function() { }); test('when connecting to invalid host', function() { - return false; var client = new Client({ user: 'aslkdjfsdf', password: '1234', @@ -125,7 +124,6 @@ test('when connecting to invalid host', function() { }); test('when connecting to invalid host with callback', function() { - return false; var client = new Client({ user: 'brian', password: '1234', @@ -137,8 +135,8 @@ test('when connecting to invalid host with callback', function() { }); test('multiple connection errors (gh#31)', function() { - return false; test('with single client', function() { + return false; //don't run yet...this test fails...need to think of fix var client = new Client({ user: 'blaksdjf', @@ -153,11 +151,6 @@ test('multiple connection errors (gh#31)', function() { assert.emits(client, 'error'); }); }); - - test('with callback method', function() { - var badConString = "tcp://aslkdfj:oi14081@"+helper.args.host+":"+helper.args.port+"/"+helper.args.database; - return false; - }); }); test('query receives error on client shutdown', function() { From 5c6e58c017d4f351a01733feb6677b00e789ba06 Mon Sep 17 00:00:00 2001 From: bmc Date: Sun, 30 Jun 2013 11:37:03 -0700 Subject: [PATCH 2/3] Remove uv_poll error short-circuit Fixes #350 --- src/binding.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/binding.cc b/src/binding.cc index e0b087e..91c5925 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -87,8 +87,7 @@ public: TRACE("Received IO event"); if(status == -1) { - LOG("Connection error."); - return; + TRACE("Connection error. -1 status from lib_uv_poll"); } Connection *connection = static_cast(w->data); From d3ba322e3caf6a9c6678b947cb5cf3d8ec619d4b Mon Sep 17 00:00:00 2001 From: Brian Carlson Date: Fri, 5 Jul 2013 12:52:04 -0500 Subject: [PATCH 3/3] Add more output to test to help debug it on travis --- test/integration/client/error-handling-tests.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/integration/client/error-handling-tests.js b/test/integration/client/error-handling-tests.js index ae8a3d1..dccfd02 100644 --- a/test/integration/client/error-handling-tests.js +++ b/test/integration/client/error-handling-tests.js @@ -119,7 +119,13 @@ test('when connecting to invalid host', function() { password: '1234', host: 'asldkfjasdf!!#1308140.com' }); - assert.emits(client, 'error'); + var delay = 5000; + var tid = setTimeout(function() { + assert(false, "When connecting to an invalid host the error event should be emitted but it has been " + delay + " and still no error event."); + }, delay); + client.on('error', function() { + clearTimeout(tid); + }) client.connect(); }); @@ -135,8 +141,8 @@ test('when connecting to invalid host with callback', function() { }); test('multiple connection errors (gh#31)', function() { + return false; test('with single client', function() { - return false; //don't run yet...this test fails...need to think of fix var client = new Client({ user: 'blaksdjf', @@ -151,6 +157,11 @@ test('multiple connection errors (gh#31)', function() { assert.emits(client, 'error'); }); }); + + test('with callback method', function() { + var badConString = "tcp://aslkdfj:oi14081@"+helper.args.host+":"+helper.args.port+"/"+helper.args.database; + return false; + }); }); test('query receives error on client shutdown', function() {