[Groonga-commit] groonga/express-droonga at bc4f3f3 [master] test: create new backend after unconnected error is handled

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jul 20 23:43:35 JST 2013


Kouhei Sutou	2013-07-20 23:43:35 +0900 (Sat, 20 Jul 2013)

  New Revision: bc4f3f31d9a1f2ae27ae7d7e2f530bfe219a9405
  https://github.com/groonga/express-droonga/commit/bc4f3f31d9a1f2ae27ae7d7e2f530bfe219a9405

  Message:
    test: create new backend after unconnected error is handled

  Modified files:
    test/backend-connection.test.js

  Modified: test/backend-connection.test.js (+9 -4)
===================================================================
--- test/backend-connection.test.js    2013-07-20 23:38:13 +0900 (14bf80d)
+++ test/backend-connection.test.js    2013-07-20 23:43:35 +0900 (129cb12)
@@ -461,22 +461,27 @@ suite('Connection', function() {
           });
           return deferred;
         })
-        .createBackend()
-        .next(function(newBackend) {
-          restartedBackend = newBackend;
+        .next(function() {
+          var deferred = new Deferred();
 
           errorHandler = nodemock
             .mock('handle')
               .takes({});
           connection.on('error', function(error) {
             errorHandler.handle(error);
+            deferred.call();
           });
 
           connection.emitMessage('test', { message: true });
+
+          return deferred;
         })
-        .wait(0.1)
         .next(function() {
           errorHandler.assertThrows();
+        })
+        .createBackend()
+        .next(function(newBackend) {
+          restartedBackend = newBackend;
           assert.equal(backend.received.length,
                        1,
                        'no new message should be sent to the old backend' + JSON.stringify(backend.received));
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index