Repository: ambari
Updated Branches:
  refs/heads/trunk 4e2b2d848 -> 53969a530


AMBARI-12027 ambari-server unit tests: HDP stack test suite freezes on test 
error/failure

Avoided waiting on the results queue


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53969a53
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53969a53
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53969a53

Branch: refs/heads/trunk
Commit: 53969a5304fdba6ceb809fb90aff02b0243a1689
Parents: 4e2b2d8
Author: Florian Barca <fba...@hortonworks.com>
Authored: Tue Jul 21 09:35:48 2015 -0700
Committer: Florian Barca <fba...@hortonworks.com>
Committed: Tue Jul 21 09:42:36 2015 -0700

----------------------------------------------------------------------
 ambari-server/src/test/python/unitTests.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/53969a53/ambari-server/src/test/python/unitTests.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/unitTests.py 
b/ambari-server/src/test/python/unitTests.py
index 7ad3add..f16c280 100644
--- a/ambari-server/src/test/python/unitTests.py
+++ b/ambari-server/src/test/python/unitTests.py
@@ -20,6 +20,7 @@ import unittest
 import multiprocessing
 import os
 import sys
+from Queue import Empty
 from random import shuffle
 import fnmatch
 import tempfile
@@ -187,11 +188,19 @@ def main():
                                             executor_result)
           )
     process.start()
-    process.join()
-    #for pretty output
-    sys.stdout.flush()
-    sys.stderr.flush()
-    variant_result = executor_result.get()
+    while process.is_alive():
+      process.join(10)
+
+      #for pretty output
+      sys.stdout.flush()
+      sys.stderr.flush()
+
+      try:
+        variant_result = executor_result.get_nowait()
+        break
+      except Empty as ex:
+        pass
+
     test_runs += variant_result['tests_run']
     test_errors.extend(variant_result['errors'])
     test_failures.extend(variant_result['failures'])

Reply via email to