diff options
author | Richard Kreuter <richard@10gen.com> | 2010-06-11 17:05:02 -0400 |
---|---|---|
committer | Richard Kreuter <richard@10gen.com> | 2010-06-11 17:06:00 -0400 |
commit | 29cff651d4b89e82001dec35b4622ff804554f99 (patch) | |
tree | 0c017aaaffac00955f169a5072b8498e806e08ed /buildscripts | |
parent | 58e6ac6b3cf239146d4fce9ed99eae584116b0e4 (diff) | |
download | mongo-29cff651d4b89e82001dec35b4622ff804554f99.tar.gz |
Make smoke.py more careful about exit status SERVER-253 & SERVER-1051
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/smoke.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py index 881c4fa213e..ec9e51a1a08 100755 --- a/buildscripts/smoke.py +++ b/buildscripts/smoke.py @@ -26,6 +26,11 @@ tests = [] winners = [] losers = {} +# Finally, atexit functions seem to be a little oblivious to whether +# Python is exiting because of an error, so we'll use this to +# communicate with the report() function. +exit_bad = True + # For replication hash checking replicated_dbs = [] lost_in_slave = [] @@ -99,7 +104,7 @@ class mongod(object): self.port += 1 self.slave = True if os.path.exists ( dirName ): - Popen( ["python", "buildscripts/cleanbb.py", dirName] ) + call( ["python", "buildscripts/cleanbb.py", dirName] ) utils.ensureDir( dirName ) argv = [mongodExecutable, "--port", str(self.port), "--dbpath", dirName] if 'smallOplog' in self.kwargs: @@ -290,7 +295,7 @@ at the end of testing:""" print "%s\t %s" % (db, screwy_in_slave[db]) if smallOplog and not (lost_in_master or lost_in_slave or screwy_in_slave): print "replication ok for %d databases" % (len(replicated_dbs)) - if (losers or lost_in_slave or lost_in_master or screwy_in_slave): + if (exit_bad or losers or lost_in_slave or lost_in_master or screwy_in_slave): status = 1 else: status = 0 @@ -417,7 +422,8 @@ def main(): elif options.mode == 'files': tests = [(os.path.abspath(test), True) for test in tests] - return runTests(tests) + runTests(tests) + exit_bad = False atexit.register(report) |