summaryrefslogtreecommitdiff
path: root/buildscripts/smoke.py
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2014-10-28 16:25:35 -0400
committerAndrew Morrow <acm@mongodb.com>2014-10-29 23:18:07 -0400
commit2f67e702915e1a7f400875ab28d10a10873581a3 (patch)
tree01cf77a75914748cc81f0963ed14573ed9d2c739 /buildscripts/smoke.py
parent52b86fc2793042fe50dda8bf47844b71b3eb6e8d (diff)
downloadmongo-2f67e702915e1a7f400875ab28d10a10873581a3.tar.gz
SERVER-15710 Support for leak detection in JS tests fun through smoke.py
Diffstat (limited to 'buildscripts/smoke.py')
-rwxr-xr-xbuildscripts/smoke.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py
index fa00b907a12..ef9ec3d5bed 100755
--- a/buildscripts/smoke.py
+++ b/buildscripts/smoke.py
@@ -327,6 +327,14 @@ class mongod(NullMongod):
sys.stderr.flush()
sys.stdout.flush()
+ # Fail hard if mongod terminates with an error. That might indicate that an
+ # instrumented build (e.g. LSAN) has detected an error. For now we aren't doing this on
+ # windows because the exit code seems to be unpredictable. We don't have LSAN there
+ # anyway.
+ retcode = self.proc.returncode
+ if os.sys.platform != "win32" and retcode != 0:
+ raise(Exception('mongod process exited with non-zero code %d' % retcode))
+
def wait_for_repl(self):
Connection(port=self.port).testing.smokeWait.insert({}, w=2, wtimeout=5*60*1000)
@@ -1258,7 +1266,7 @@ def main():
default=False,
help='Clear database files before first test')
parser.add_option('--clean-every', dest='clean_every_n_tests', type='int',
- default=20,
+ default=(1 if 'detect_leaks=1' in os.getenv("ASAN_OPTIONS", "") else 20),
help='Clear database files every N tests [default %default]')
parser.add_option('--dont-start-mongod', dest='start_mongod', default=True,
action='store_false',