[Zope3-checkins] SVN: zope.testing/branches/3.9/ Side-port fix for subprocess buffering from z.testrunner, r123154.

Tres Seaver tseaver at palladion.com
Wed Nov 2 15:24:24 UTC 2011


Log message for revision 123251:
  Side-port fix for subprocess buffering from z.testrunner, r123154.

Changed:
  U   zope.testing/branches/3.9/CHANGES.txt
  U   zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-layers-buff.txt

-=-
Modified: zope.testing/branches/3.9/CHANGES.txt
===================================================================
--- zope.testing/branches/3.9/CHANGES.txt	2011-11-02 15:10:02 UTC (rev 123250)
+++ zope.testing/branches/3.9/CHANGES.txt	2011-11-02 15:24:24 UTC (rev 123251)
@@ -4,7 +4,8 @@
 3.9.7 (unreleased)
 ==================
 
-- Nothing changed yet.
+- Work around sporadic timing-related issues in the subprocess buffering
+  tests.  Thanks to Jonathan Ballet for the patch!
 
 
 3.9.6 (2011-02-21)

Modified: zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-layers-buff.txt
===================================================================
--- zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-layers-buff.txt	2011-11-02 15:10:02 UTC (rev 123250)
+++ zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-layers-buff.txt	2011-11-02 15:24:24 UTC (rev 123251)
@@ -65,15 +65,19 @@
 second.  Before the change that this test verifies, there was a single pause of
 more than a second after the second suite ran.
 
-    >>> pause = datetime.timedelta(seconds=0.3)
-    >>> last_line, last_time = record.pop(0)
-    >>> for line, time in record:
-    ...     if time-last_time >= pause:
-    ...         # We paused!
-    ...         print 'PAUSE FOUND BETWEEN THESE LINES:'
-    ...         print ''.join([last_line, line, '-'*70])
-    ...     last_line, last_time = line, time
-    ... # doctest: +ELLIPSIS
+    >>> def assert_progressive_output():
+    ...     pause = datetime.timedelta(seconds=0.3)
+    ...     last_line, last_time = record.pop(0)
+    ...     print '---'
+    ...     for line, time in record:
+    ...         if time-last_time >= pause:
+    ...             # We paused!
+    ...             print 'PAUSE FOUND BETWEEN THESE LINES:'
+    ...             print ''.join([last_line, line, '-'*70])
+    ...         last_line, last_time = line, time
+
+    >>> assert_progressive_output() # doctest: +ELLIPSIS
+    ---...
     PAUSE FOUND BETWEEN THESE LINES:...
       Running:
      test_something (sampletests_buffering.TestSomething2)
@@ -81,7 +85,7 @@
     PAUSE FOUND BETWEEN THESE LINES:
      test_something (sampletests_buffering.TestSomething2)
      test_something2 (sampletests_buffering.TestSomething2)
-    ----------------------------------------------------------------------
+    ---...
 
 Because this is a test based on timing, it may be somewhat fragile.  However,
 on a relatively slow machine, this timing works out fine; I'm hopeful that this
@@ -127,14 +131,19 @@
 automated agent. In particular for the second point, notice below that, as
 before, the progress output is not buffered.
 
-    >>> last_line, last_time = record.pop(0)
-    >>> for line, time in record:
-    ...     if time-last_time >= pause:
-    ...         # We paused!
-    ...         print 'PAUSE FOUND BETWEEN THIS OUTPUT:'
-    ...         print '\n'.join([last_line, line, '-'*70])
-    ...     last_line, last_time = line, time
-    ... # doctest: +ELLIPSIS
+    >>> def assert_progressive_output():
+    ...     pause = datetime.timedelta(seconds=0.3)
+    ...     last_line, last_time = record.pop(0)
+    ...     print '---'
+    ...     for line, time in record:
+    ...         if time-last_time >= pause:
+    ...             # We paused!
+    ...             print 'PAUSE FOUND BETWEEN THIS OUTPUT:'
+    ...             print '\n'.join([last_line, line, '-'*70])
+    ...         last_line, last_time = line, time
+
+    >>> assert_progressive_output() # doctest: +ELLIPSIS
+    ---...
     PAUSE FOUND BETWEEN THIS OUTPUT:...
     .
     .
@@ -142,7 +151,7 @@
     PAUSE FOUND BETWEEN THIS OUTPUT:
     .
      LAYER FINISHED
-    ----------------------------------------------------------------------
+    ---...
 
 
 Fake an IOError reading the output of the subprocess to exercise the



More information about the Zope3-Checkins mailing list