You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dd...@apache.org on 2011/12/22 06:39:12 UTC

svn commit: r1222043 - /incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py

Author: ddas
Date: Thu Dec 22 05:39:12 2011
New Revision: 1222043

URL: http://svn.apache.org/viewvc?rev=1222043&view=rev
Log:
AMBARI-171. Testcase improved.

Modified:
    incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py

Modified: incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py?rev=1222043&r1=1222042&r2=1222043&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py (original)
+++ incubator/ambari/trunk/agent/src/test/python/TestActionQueue.py Thu Dec 22 05:39:12 2011
@@ -72,10 +72,14 @@ class TestActionQueue(TestCase):
     actionQueue.maxRetries = 2
     actionQueue.sleepInterval = 1
     result = actionQueue.put(response)
-    time.sleep(5)
+    results = actionQueue.result()
+    sleptCount = 1
+    while (len(results) < 2 and sleptCount < 15):
+        time.sleep(1)
+        sleptCount += 1
+        results = actionQueue.result()
     actionQueue.stop()
     actionQueue.join()
-    results = actionQueue.result()
     self.assertEqual(len(results), 2, 'Number of results is not 2.')
     result = results[0]
     maxretries = config.get('command', 'maxretries')