From b05fdfd3babd634a510573c9f08b851cb0de6d7e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 22 Jul 2024 14:20:08 +0900 Subject: [PATCH] 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. --- tests/wamr-test-suites/spec-test-script/runtest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/wamr-test-suites/spec-test-script/runtest.py b/tests/wamr-test-suites/spec-test-script/runtest.py index 2713c494..8e53ddbc 100755 --- a/tests/wamr-test-suites/spec-test-script/runtest.py +++ b/tests/wamr-test-suites/spec-test-script/runtest.py @@ -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):