[Checkins] SVN: zope.server/branches/achapman-last_activity-bug/src/zope/server/ - add test and fix for another possible bad channel closing

Alex Chapman achapman at zope.com
Tue Sep 13 14:49:27 EST 2011


Log message for revision 122795:
   - add test and fix for another possible bad channel closing
  

Changed:
  U   zope.server/branches/achapman-last_activity-bug/src/zope/server/dualmodechannel.py
  U   zope.server/branches/achapman-last_activity-bug/src/zope/server/tests/test_zombies.py

-=-
Modified: zope.server/branches/achapman-last_activity-bug/src/zope/server/dualmodechannel.py
===================================================================
--- zope.server/branches/achapman-last_activity-bug/src/zope/server/dualmodechannel.py	2011-09-13 18:28:00 UTC (rev 122794)
+++ zope.server/branches/achapman-last_activity-bug/src/zope/server/dualmodechannel.py	2011-09-13 19:49:27 UTC (rev 122795)
@@ -146,6 +146,7 @@
         """
         self.async_mode = True
         self.pull_trigger()
+        self.last_activity = time()
 
     #
     # METHODS USED IN BOTH MODES

Modified: zope.server/branches/achapman-last_activity-bug/src/zope/server/tests/test_zombies.py
===================================================================
--- zope.server/branches/achapman-last_activity-bug/src/zope/server/tests/test_zombies.py	2011-09-13 18:28:00 UTC (rev 122794)
+++ zope.server/branches/achapman-last_activity-bug/src/zope/server/tests/test_zombies.py	2011-09-13 19:49:27 UTC (rev 122795)
@@ -126,6 +126,21 @@
     >>> channel3.connected
     True
 
+    Main loop window
+    ----------------
+
+    There is also a corner case we'll do a shallow test for where a
+    channel can be closed waiting for the main loop.
+
+    >>> channel4.last_activity -= 1
+
+    >>> last_active = channel4.last_activity
+
+    >>> channel4.set_async()
+
+    >>> channel4.last_activity != last_active
+    True
+
 """
 
 def test_suite():



More information about the checkins mailing list