[Zope3-dev] PATCH for: FreeBSD Test Results - Zope 3 / Python 2.2 - Not OK :-(

Barry Pederson bp@barryp.org
Mon, 03 Mar 2003 11:36:43 -0600


This is a multi-part message in MIME format.
--------------070601060902030603020908
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

> Running tests from /var/home/rdmurray/proj/zopeautotest/sandbox/Zope3
> Exception in thread Connect([(2, ('localhost', 28702)), (2, ('localhost', 28024))]):
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.2/threading.py", line 408, in __bootstrap
>     self.run()
>   File "/var/home/rdmurray/proj/zopeautotest/sandbox/Zope3/src/zodb/zeo/zrpc/client.py", line 287, in run
>     success = self.try_connecting(attempt_timeout)
>   File "/var/home/rdmurray/proj/zopeautotest/sandbox/Zope3/src/zodb/zeo/zrpc/client.py", line 320, in try_connecting
>     r = self._fallback_wrappers(wrappers, deadline)
>   File "/var/home/rdmurray/proj/zopeautotest/sandbox/Zope3/src/zodb/zeo/zrpc/client.py", line 390, in _fallback_wrappers
>     assert wrap.state == "tested" and wrap.preferred == 0
> AssertionError


It's been bugging me to see this every day, I think I have a fix for the 
problem attached, a patch to zodb/zeo/zprc/client.py  Main problem 
seemed to be reusing the name "wrap" as a loop variable in a 
questionable way and/or not removing closed wrappers from the dict that 
gets returned.

My not-so-blazingly fast mini-ITX box running FreeBSD gets a lot of 
"connection refused" type errors  when running the tests, so I'd suggest 
tweaking zodb/zeo/tests/forker.py to increase the delay a bit, and have 
attached a patch for that too.

     Barry


--------------070601060902030603020908
Content-Type: text/plain;
 name="client.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="client.patch"

--- client.py.old	Mon Mar  3 11:11:21 2003
+++ client.py	Mon Mar  3 11:15:48 2003
@@ -335,10 +335,9 @@
             wrap = ConnectWrapper(domain, addr, self.mgr, self.client)
             wrap.connect_procedure()
             if wrap.state == "notified":
-                for wrap in wrappers.keys():
-                    wrap.close()
-                wrappers[wrap] = wrap
-                return wrappers
+                for wrap2 in wrappers.keys():
+                    wrap2.close()
+                return {wrap: wrap}
             if wrap.state != "closed":
                 wrappers[wrap] = wrap
         return wrappers

--------------070601060902030603020908
Content-Type: text/plain;
 name="forker.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="forker.patch"

--- forker.py.old	Mon Mar  3 11:11:21 2003
+++ forker.py	Sat Mar  1 13:23:41 2003
@@ -93,7 +93,7 @@
     # We need to wait until the server starts, but not forever.
     # Always do a sleep as the first thing, since we don't expect
     # the spawned process to get started right away.
-    delay = 0.25
+    delay = 0.5
     for i in range(10):
         time.sleep(delay)
         logging.debug('forker: connect %s', i)

--------------070601060902030603020908--