Commit 4c0e894e authored by R. David Murray's avatar R. David Murray

Merged revisions 78558 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78558 | r.david.murray | 2010-03-01 14:14:16 -0500 (Mon, 01 Mar 2010) | 6 lines

  Issue 3892 again.  The bsddb3 replication test still fails randomly.
  Since this module is unmaintained in the library and gone in py3k,
  this patch skips the remainder of the replication test if a
  second timeout occurs, as it randomly does.  This should improve buildbot
  stability.
........
parent ec79ff3a
...@@ -119,24 +119,18 @@ class DBReplicationManager(unittest.TestCase): ...@@ -119,24 +119,18 @@ class DBReplicationManager(unittest.TestCase):
timeout = time.time()+60 timeout = time.time()+60
while (time.time()<timeout) and not (self.confirmed_master and self.client_startupdone) : while (time.time()<timeout) and not (self.confirmed_master and self.client_startupdone) :
time.sleep(0.02) time.sleep(0.02)
# this fails on Windows as self.client_startupdone never gets set # self.client_startupdone does not always get set to True within
# to True - see bug 3892. BUT - even though this assertion # the timeout. On windows this may be a deep issue, on other
# fails on Windows the rest of the test passes - so to prove # platforms it is likely just a timing issue, especially on slow
# that we let the rest of the test run. Sadly we can't # virthost buildbots (see issue 3892 for more). Even though
# make use of raising TestSkipped() here (unittest still # the timeout triggers, the rest of this test method usually passes
# reports it as an error), so we yell to stderr. # (but not all of it always, see below). So we just note the
import sys # timeout on stderr and keep soldering on.
if sys.platform=="win32": if time.time()>timeout:
print >> sys.stderr, \ import sys
"XXX - windows bsddb replication fails on windows and is skipped" print >> sys.stderr, ("XXX: timeout happened before"
print >> sys.stderr, "XXX - Please see issue #3892" "startup was confirmed - see issue 3892")
# It also fails irregularly on other platforms, and again the startup_timeout = True
# rest of the tests pass. Since bsddb support is unmaintained, and
# is gone in py3k, we just emit a warning instead of a test failure
# so as to improve buildbot stability.
elif time.time()>timeout:
print >> sys.stderr, \
"XXX - timeout before startup confirmed, see issue #3892."
d = self.dbenvMaster.repmgr_site_list() d = self.dbenvMaster.repmgr_site_list()
self.assertEquals(len(d), 1) self.assertEquals(len(d), 1)
...@@ -194,6 +188,14 @@ class DBReplicationManager(unittest.TestCase): ...@@ -194,6 +188,14 @@ class DBReplicationManager(unittest.TestCase):
txn.commit() txn.commit()
if v==None : if v==None :
time.sleep(0.02) time.sleep(0.02)
# If startup did not happen before the timeout above, then this test
# sometimes fails. This happens randomly, which causes buildbot
# instability, but all the other bsddb tests pass. Since bsddb3 in the
# stdlib is currently not getting active maintenance, and is gone in
# py3k, we just skip the end of the test in that case.
if time.time()>=timeout and startup_timeout:
self.skipTest("replication test skipped due to random failure, "
"see issue 3892")
self.assertTrue(time.time()<timeout) self.assertTrue(time.time()<timeout)
self.assertEquals("123", v) self.assertEquals("123", v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment