Bug 1029204 - |mach valgrind-test|: add a timeout. r=ted.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 10 Jul 2014 21:05:22 -0700
changeset 193535 e08b171b9a02ddafd725b2b772d5a3209fea6637
parent 193534 805ac89b59240d1cec3116591cba55d51f0aaa7e
child 193536 2bdf8a5472ce8815c4bf8450803c4c67043a6d13
push id27123
push userryanvm@gmail.com
push dateFri, 11 Jul 2014 20:35:05 +0000
treeherdermozilla-central@84bd8d9f4256 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1029204
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1029204 - |mach valgrind-test|: add a timeout. r=ted.
build/valgrind/mach_commands.py
--- a/build/valgrind/mach_commands.py
+++ b/build/valgrind/mach_commands.py
@@ -121,38 +121,45 @@ class MachCommands(MachCommandBase):
             # MACHTYPE is an odd bash-only environment variable that doesn't
             # show up in os.environ, so we have to get it another way.
             machtype = subprocess.check_output(['bash', '-c', 'echo $MACHTYPE']).rstrip()
             supps_file2 = os.path.join(supps_dir, machtype + '.sup')
             if os.path.isfile(supps_file2):
                 valgrind_args.append('--suppressions=' + supps_file2)
 
             exitcode = None
+            timeout = 1100
             try:
                 runner = FirefoxRunner(profile=profile,
                                        binary=self.get_binary_path(),
                                        cmdargs=firefox_args,
                                        env=env,
                                        process_args=kp_kwargs)
                 runner.start(debug_args=valgrind_args)
-                exitcode = runner.wait()
+                # This timeout is slightly less than the no-output timeout on
+                # TBPL, so we'll timeout here first and give an informative
+                # message.
+                exitcode = runner.wait(timeout=timeout)
 
             finally:
                 errs = outputHandler.error_count
                 supps = outputHandler.suppression_count
                 if errs != supps:
                     status = 1  # turns the TBPL job orange
-                    print('TEST-UNEXPECTED-FAILURE | valgrind-test | error parsing:', errs, "errors seen, but", supps, "generated suppressions seen")
+                    print('TEST-UNEXPECTED-FAIL | valgrind-test | error parsing: {} errors seen, but {} generated suppressions seen'.format(errs, supps))
 
                 elif errs == 0:
                     status = 0
                     print('TEST-PASS | valgrind-test | valgrind found no errors')
                 else:
                     status = 1  # turns the TBPL job orange
                     # We've already printed details of the errors.
 
-                if exitcode != 0:
+                if exitcode == None:
+                    status = 2  # turns the TBPL job red
+                    print('TEST-UNEXPECTED-FAIL | valgrind-test | Valgrind timed out (reached {} second limit)'.format(timeout))
+                elif exitcode != 0:
                     status = 2  # turns the TBPL job red
                     print('TEST-UNEXPECTED-FAIL | valgrind-test | non-zero exit code from Valgrind')
 
                 httpd.stop()
 
             return status