SVN: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/ checkpoint

Benji York <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <20080703040150.EAE2D39A2A__8313.15305918015$1215057791$gmane$org@mail.zope.org>
Log message for revision 87944:
  checkpoint
  

Changed:
  U   zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/layer.py
  U   zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py

-=-
Modified: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/layer.py
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/layer.py	2008-07-03 00:38:39 UTC (rev 87943)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/layer.py	2008-07-03 04:01:49 UTC (rev 87944)
@@ -19,3 +19,7 @@
 
 class UnitTests(object):
     """A layer for gathering all unit tests."""
+
+    @staticmethod
+    def tearDown():
+        raise NotImplementedError

Modified: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py	2008-07-03 00:38:39 UTC (rev 87943)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py	2008-07-03 04:01:49 UTC (rev 87944)
@@ -438,8 +438,10 @@
             thread.start()
             running_threads.append(thread)
 
-        running_threads[0].join()
-        del running_threads[0]
+        for index, thread in list(enumerate(running_threads)):
+            if not thread.isAlive():
+                del running_threads[index]
+        time.sleep(0.1)
 
     # Gather up all the results.
     rantotal = 0
@@ -626,11 +628,17 @@
     gathered.reverse()
     seen = {}
     result = []
+
     for layer in gathered:
         if layer not in seen:
             seen[layer] = 1
             if layer in layers:
-                result.append(layer)
+                if (name_from_layer(layer) ==
+                    'zope.testing.testrunner.layer.UnitTests'):
+                    result.insert(0, layer)
+                else:
+                    result.append(layer)
+
     return result
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.