diff --git a/src/binding.cc b/src/binding.cc index 0ad0cdb1..a1c56853 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); diff --git a/test/integration/client/error-handling-tests.js b/test/integration/client/error-handling-tests.js index 1f02597f..dccfd02e 100644 --- a/test/integration/client/error-handling-tests.js +++ b/test/integration/client/error-handling-tests.js @@ -114,18 +114,22 @@ test('non-error calls supplied callback', function() { }); test('when connecting to invalid host', function() { - return false; var client = new Client({ user: 'aslkdjfsdf', 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(); }); test('when connecting to invalid host with callback', function() { - return false; var client = new Client({ user: 'brian', password: '1234',