Browse Source

[2922] Limit number of attempts during tests

Michal 'vorner' Vaner 12 years ago
parent
commit
779d5913cc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bin/msgq/tests/msgq_run_test.py

+ 2 - 1
src/bin/msgq/tests/msgq_run_test.py

@@ -312,12 +312,13 @@ class MsgqRunTest(unittest.TestCase):
         # do so manually.
         synchronised = False
         attempts = 100
-        while not synchronised:
+        while not synchronised and attempts > 0:
             time.sleep(0.1)
             seq = conn.group_sendmsg({'command': ['Are you running?']},
                                      'Msgq', want_answer=True)
             msg = conn.group_recvmsg(nonblock=False, seq=seq)
             synchronised = msg[0] != -1
+            attempts -= 1
         self.assertTrue(synchronised)
         # The actual test
         conn.group_subscribe("notifications/cc_members")