mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
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:
parent
0d8ffebd39
commit
b05fdfd3ba
|
@ -273,6 +273,8 @@ parser.add_argument('--rundir',
|
||||||
help="change to the directory before running tests")
|
help="change to the directory before running tests")
|
||||||
parser.add_argument('--start-timeout', default=30, type=int,
|
parser.add_argument('--start-timeout', default=30, type=int,
|
||||||
help="default timeout for initial prompt")
|
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,
|
parser.add_argument('--test-timeout', default=20, type=int,
|
||||||
help="default timeout for each individual test action")
|
help="default timeout for each individual test action")
|
||||||
parser.add_argument('--no-pty', action='store_true',
|
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:
|
if test_aot:
|
||||||
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
|
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
|
||||||
try:
|
try:
|
||||||
assert_prompt(r, ['Compile success'], opts.start_timeout, True)
|
assert_prompt(r, ['Compile success'], opts.start_fail_timeout, True)
|
||||||
except:
|
except:
|
||||||
_, exc, _ = sys.exc_info()
|
_, exc, _ = sys.exc_info()
|
||||||
if (r.buf.find(expected) >= 0):
|
if (r.buf.find(expected) >= 0):
|
||||||
|
@ -1251,7 +1253,7 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
|
||||||
if loadable:
|
if loadable:
|
||||||
# Wait for the initial prompt
|
# Wait for the initial prompt
|
||||||
try:
|
try:
|
||||||
assert_prompt(r, ['webassembly> '], opts.start_timeout, True)
|
assert_prompt(r, ['webassembly> '], opts.start_fail_timeout, True)
|
||||||
except:
|
except:
|
||||||
_, exc, _ = sys.exc_info()
|
_, exc, _ = sys.exc_info()
|
||||||
if (r.buf.find(expected) >= 0):
|
if (r.buf.find(expected) >= 0):
|
||||||
|
@ -1331,7 +1333,7 @@ if __name__ == "__main__":
|
||||||
if test_aot:
|
if test_aot:
|
||||||
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
|
r = compile_wasm_to_aot(wasm_tempfile, aot_tempfile, True, opts, r)
|
||||||
try:
|
try:
|
||||||
assert_prompt(r, ['Compile success'], opts.start_timeout, True)
|
assert_prompt(r, ['Compile success'], opts.start_fail_timeout, True)
|
||||||
except:
|
except:
|
||||||
_, exc, _ = sys.exc_info()
|
_, exc, _ = sys.exc_info()
|
||||||
if (r.buf.find(error_msg) >= 0):
|
if (r.buf.find(error_msg) >= 0):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user