[Groonga-commit] groonga/express-droonga at 9ab9f15 [master] test: use "receive" event to detect message is sent instead of wait()

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Sat Jul 20 23:57:06 JST 2013


Kouhei Sutou	2013-07-20 23:57:06 +0900 (Sat, 20 Jul 2013)

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

  Message:
    test: use "receive" event to detect message is sent instead of wait()
    
    wait() makes test fragile.

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

  Modified: test/backend-connection.test.js (+6 -1)
===================================================================
--- test/backend-connection.test.js    2013-07-20 23:54:31 +0900 (9fff943)
+++ test/backend-connection.test.js    2013-07-20 23:57:06 +0900 (aa5e1ce)
@@ -488,8 +488,13 @@ suite('Connection', function() {
                            []);
 
           connection.emitMessage('type3', { message: true });
+
+          var deferred = new Deferred();
+          restartedBackend.once("receive", function() {
+            deferred.call();
+          });
+          return deferred;
         })
-        .wait(0.01)
         .next(function() {
           assert.equal(backend.received.length,
                        1,
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る