spec-test-script/runtest.py: Use a shorter timeout when expected to fail (#3647)

This is a band-aid fix; ideally we should wait for the expected
failure message directly with a timeout, not the successful prompt
as we currently do.
This commit is contained in:
YAMAMOTO Takashi 2024-07-22 14:20:08 +09:00 committed by GitHub
parent 0d8ffebd39
commit b05fdfd3ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,6 +273,8 @@ parser.add_argument('--rundir',
help="change to the directory before running tests")
parser.add_argument('--start-timeout', default=30, type=int,
help="default timeout for initial prompt")
parser.add_argument('--start-fail-timeout', default=2, type=int,
help="default timeout for initial prompt (when expected to fail)")
parser.add_argument('--test-timeout', default=20, type=int,
help="default timeout for each individual test action")
parser.add_argument('--no-pty', action='store_true',
@ -1230,7 +1232,7 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
if test_aot:
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
try:
assert_prompt(r, ['Compile success'], opts.start_timeout, True)
assert_prompt(r, ['Compile success'], opts.start_fail_timeout, True)
except:
_, exc, _ = sys.exc_info()
if (r.buf.find(expected) >= 0):
@ -1251,7 +1253,7 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
if loadable:
# Wait for the initial prompt
try:
assert_prompt(r, ['webassembly> '], opts.start_timeout, True)
assert_prompt(r, ['webassembly> '], opts.start_fail_timeout, True)
except:
_, exc, _ = sys.exc_info()
if (r.buf.find(expected) >= 0):
@ -1331,7 +1333,7 @@ if __name__ == "__main__":
if test_aot:
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
try:
assert_prompt(r, ['Compile success'], opts.start_timeout, True)
assert_prompt(r, ['Compile success'], opts.start_fail_timeout, True)
except:
_, exc, _ = sys.exc_info()
if (r.buf.find(error_msg) >= 0):