Rev 4624: -Eslices conditions statistics display. in file:///home/vila/src/bzr/bugs/selftest/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Aug 18 21:45:20 BST 2009


At file:///home/vila/src/bzr/bugs/selftest/

------------------------------------------------------------
revno: 4624
revision-id: v.ladeuil+lp at free.fr-20090818204520-aea1jsj2586r3ig7
parent: v.ladeuil+lp at free.fr-20090818171407-s4jyuywutq8yx681
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: selftest
timestamp: Tue 2009-08-18 22:45:20 +0200
message:
  -Eslices conditions statistics display.
  
  * bzrlib/tests/__init__.py:
  (selftest_debug_flags): Add a 'slices' debug flag.
  (fork_for_tests.TestInOtherProcess.run): Display some key
  statistics related to test suite slicing.
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-08-18 17:14:07 +0000
+++ b/bzrlib/tests/__init__.py	2009-08-18 20:45:20 +0000
@@ -3066,8 +3066,8 @@
                 # slice size from there.
                 slice_size = ((nb_tests - cur_test)
                               / (concurrency * concurrency)) + 8
-                print '%5d/%5d ------> New slice on %d: %5d' % (
-                    cur_test, nb_tests, self.rank, slice_size)
+                if 'slices' in selftest_debug_flags:
+                    note('New slice for %d: %5d', self.rank, slice_size)
                 # give a slice to first free child
                 first, last = cur_test, cur_test + slice_size
                 shared_cur_test[0] = last
@@ -3081,8 +3081,9 @@
                 self.suite_semaphore.acquire()
                 cur_test = shared_cur_test[0]
             self.suite_semaphore.release()
-            print '%d ran %d test in %d slices' % (
-                self.rank, self.nb_tests, self.nb_slices)
+            if 'slices' in selftest_debug_flags:
+                note('%d ran %5d tests in %5d slices',
+                     self.rank, self.nb_tests, self.nb_slices)
 
         def run_slice(self, result, tests):
             (f_read, f_write) = os.pipe()
@@ -3230,6 +3231,8 @@
 #                           rather than failing tests. And no longer raise
 #                           LockContention when fctnl locks are not being used
 #                           with proper exclusion rules.
+#   -Eslices                Will output information about how the test suite is
+#                           sliced while running with --parallel=fork
 selftest_debug_flags = set()
 
 



More information about the bazaar-commits mailing list