Bug 1291954 - Avoid problems with timeouts when running under tsan, r=jonco
authorSteve Fink <sfink@mozilla.com>
Wed, 03 May 2017 07:15:50 -0700
changeset 406127 3b3067e901d4f92e61b6eeb8b5152ed24030ba44
parent 406126 cb8a328af904e54f07a8730419046b98fd57a5ec
child 406128 e03be5e59295f3bca6636094b905de81cc7b49aa
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1291954
milestone55.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 1291954 - Avoid problems with timeouts when running under tsan, r=jonco One jstest was found to run more slowly under tsan, so add it to the cgc-jittest-timeouts.txt bucket. Several jit-tests expect to timeout, and are annotated with an expected status code. Currently, we have to force tsan to report a zero status if it finds an error, since otherwise it will cause lots of tests to fail (due to hitting a tsan-detectable problem.) But those zero exit statuses cause the test to fail. Add --unusable-error-status to treat those as passing.
js/src/devtools/automation/cgc-jstests-slow.txt
js/src/devtools/automation/variants/tsan
js/src/jit-test/jit_test.py
js/src/tests/lib/jittests.py
--- a/js/src/devtools/automation/cgc-jstests-slow.txt
+++ b/js/src/devtools/automation/cgc-jstests-slow.txt
@@ -54,10 +54,12 @@ js1_5/GC/regress-278725.js
 js1_5/Regress/regress-312588.js
 js1_5/Regress/regress-321971.js
 js1_5/Regress/regress-360969-01.js
 js1_5/Regress/regress-360969-02.js
 js1_5/Regress/regress-360969-03.js
 js1_5/Regress/regress-360969-04.js
 js1_5/Regress/regress-360969-05.js
 js1_5/Regress/regress-360969-06.js
+js1_8_1/extensions/regress-477187.js
+js1_8_1/regress/regress-452498-052-a.js
 js1_8_5/extensions/clone-complex-object.js
 js1_8_5/extensions/clone-object-deep.js
--- a/js/src/devtools/automation/variants/tsan
+++ b/js/src/devtools/automation/variants/tsan
@@ -1,16 +1,16 @@
 {
     "configure-args": "--enable-debug-symbols='-gline-tables-only' --disable-jemalloc --enable-thread-sanitizer",
     "optimize": true,
     "debug": false,
     "compiler": "clang",
     "env": {
         "LLVM_SYMBOLIZER": "{TOOLTOOL_CHECKOUT}/clang/bin/llvm-symbolizer",
-        "JITTEST_EXTRA_ARGS": "--jitflags=debug --ignore-timeouts={DIR}/cgc-jittest-timeouts.txt",
+        "JITTEST_EXTRA_ARGS": "--jitflags=debug --ignore-timeouts={DIR}/cgc-jittest-timeouts.txt --unusable-error-status",
         "JSTESTS_EXTRA_ARGS": "--exclude-file={DIR}/cgc-jstests-slow.txt",
         "TSAN_OPTIONS": "exitcode=0 log_path={OUTDIR}/sanitize_log"
     },
     "[comment on expect-errors]": "Note that expect-errors may contain duplicates. These indicate that tsan reports errors as two distinct line numbers. We cannot just insert line numbers, because they will shift around between versions.",
     "expect-errors": [
         [ "Shape.h", "inDictionary" ],
         [ "jsfriendapi.h", "GetObjectClass" ],
         [ "Shape.h", "maybeSlot" ],
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -104,16 +104,18 @@ def main(argv):
     op.add_option('-g', '--debug', action='store_const', const='gdb', dest='debugger',
                   help='Run a single test under the gdb debugger')
     op.add_option('-G', '--debug-rr', action='store_const', const='rr', dest='debugger',
                   help='Run a single test under the rr debugger')
     op.add_option('--debugger', type='string',
                   help='Run a single test under the specified debugger')
     op.add_option('--valgrind', dest='valgrind', action='store_true',
                   help='Enable the |valgrind| flag, if valgrind is in $PATH.')
+    op.add_option('--unusable-error-status', action='store_true',
+                  help='Ignore incorrect exit status on tests that should return nonzero.')
     op.add_option('--valgrind-all', dest='valgrind_all', action='store_true',
                   help='Run all tests with valgrind, if valgrind is in $PATH.')
     op.add_option('--avoid-stdio', dest='avoid_stdio', action='store_true',
                   help='Use js-shell file indirection instead of piping stdio.')
     op.add_option('--write-failure-output', dest='write_failure_output',
                   action='store_true',
                   help='With --write-failures=FILE, additionally write the'
                   ' output of failed tests to [FILE]')
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -449,16 +449,21 @@ def check_output(out, err, rc, timed_out
             return True
 
         # Allow a non-zero exit code if we want to all too-much-recursion and
         # the test actually over-recursed.
         if test.allow_overrecursed and 'too much recursion' in err \
            and 'Assertion failure' not in err:
             return True
 
+        # Allow a zero exit code if we are running under a sanitizer that
+        # forces the exit status.
+        if test.expect_status != 0 and options.unusable_error_status:
+            return True
+
         return False
 
     return True
 
 def print_automation_format(ok, res):
     # Output test failures in a parsable format suitable for automation, eg:
     # TEST-RESULT | filename.js | Failure description (code N, args "--foobar")
     #