[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/recorder/tests.py doctest_RecordingProtocol(): Repair bad assumption about how

Tim Peters tim.one at comcast.net
Mon Oct 10 14:43:57 EDT 2005


Log message for revision 39033:
  doctest_RecordingProtocol():  Repair bad assumption about how
  time.time() works.
  
  This fixes frequent failures of this test on Windows.
  

Changed:
  U   Zope3/trunk/src/zope/app/recorder/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/recorder/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/recorder/tests.py	2005-10-10 18:43:17 UTC (rev 39032)
+++ Zope3/trunk/src/zope/app/recorder/tests.py	2005-10-10 18:43:57 UTC (rev 39033)
@@ -80,7 +80,7 @@
       This is my answer.
 
     Once the request is finished and the response is written, the connection
-    is closed and a recorded request obejct is written:
+    is closed and a recorded request object is written:
 
       >>> recording.connectionLost(None)
 
@@ -89,7 +89,12 @@
       >>> len(recorder.requestStorage)
       1
       >>> rq = iter(recorder.requestStorage).next()
-      >>> rq.timestamp < time.time()
+
+    Especially on Windows, time.time() now may not be strictly greater than
+    an earlier time.time() return value, so we only check for that current
+    time isn't earlier than the timestamp on the request object:
+
+      >>> rq.timestamp <= time.time()
       True
       >>> rq.request_string
       'GET / HTTP/1.1\n\nhello world!\n'



More information about the Zope3-Checkins mailing list