[Zodb-checkins] CVS: ZODB3/ZEO/tests - testConnection.py:1.1.2.6
Tim Peters
tim.one at comcast.net
Thu Aug 7 13:29:26 EDT 2003
Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv15095/ZEO/tests
Modified Files:
Tag: ZODB3-3_1-branch
testConnection.py
Log Message:
WindowsConnectionTests.shutdownServer(): Grossly boost the sleep() at
the end. Before Python 2.3 there is no waitpid on Windows, and so no
way to know when a ZEO server has gone away. Tests calling
shutdownServer() assume the server has gone away when the method returns,
and can fail or hang if that isn't true. This is especially acute when
running Berkeley tests, because a Berkeley server seems to take longer
to shut itself down. The --all tests take longer on Windows now (this
patch has no effect on Linux), but did all pass for me on Win2K (incl.
the Berkeley tests).
=== ZODB3/ZEO/tests/testConnection.py 1.1.2.5 => 1.1.2.6 ===
--- ZODB3/ZEO/tests/testConnection.py:1.1.2.5 Mon Jul 28 14:59:50 2003
+++ ZODB3/ZEO/tests/testConnection.py Thu Aug 7 12:29:20 2003
@@ -104,8 +104,17 @@
time.sleep(0.5) # wait a bit and try again
s.close()
self._servers[index] = None
- # XXX waitpid() isn't available until Python 2.3
- time.sleep(0.5)
+ # XXX waitpid() isn't available until Python 2.3, and this is
+ # XXX a serious problem for the tests: we've simply got no
+ # XXX way to know when the server process exits. So long as
+ # XXX the server process is alive, any file it passed to
+ # XXX lock_file() remains in the locked state, which can
+ # XXX cause the next test (or next phase of the current test)
+ # XXX to fail (due to being unable to lock the same file).
+ # XXX Berkeley servers seem to take the longest to exit.
+ # XXX About all we can do here is sleep, hoping that the server
+ # XXX goes away. 1.0 second isn't long enough. 5.0 should be.
+ time.sleep(5.0)
class BDBConnectionTests(os.name == "nt" and WindowsConnectionTests
or UnixConnectionTests):
More information about the Zodb-checkins
mailing list