Skip to content

Commit f599ee6

Browse files
test: correct unittest rerun behavior (#5273)
Signed-off-by: Yuan Tong <[email protected]>
1 parent 516bd4d commit f599ee6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/integration/defs/test_unittests.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def test_unittests_v2(llm_root, llm_venv, case: str, output_dir, request):
6868

6969
test_root = tests_path()
7070
dry_run = False
71-
passed = True
7271

7372
my_test_prefix = request.config.getoption("--test-prefix")
7473
if my_test_prefix:
@@ -153,8 +152,7 @@ def run_command(cmd):
153152
output_dir,
154153
f'parallel-sub-results-unittests-{case_fn}.xml.intermediate')
155154
parallel_command = command + [
156-
"-n", f"{num_workers}", '--reruns', '3',
157-
f"--junitxml={parallel_output_xml}"
155+
"-n", f"{num_workers}", f"--junitxml={parallel_output_xml}"
158156
]
159157
passed = run_command(parallel_command)
160158

@@ -170,11 +168,10 @@ def run_command(cmd):
170168
output_dir,
171169
f'retry-sub-results-unittests-{case_fn}.xml.intermediate')
172170
# Run failed case sequentially.
173-
command = [
174-
'-m', 'pytest', "-p", "no:xdist", ignore_opt, "-v", '--lf',
175-
f"--junitxml={retry_output_xml}"
176-
] + arg_list
177-
passed = run_command(command)
171+
retry_command = command + [
172+
"-p", "no:xdist", '--lf', f"--junitxml={retry_output_xml}"
173+
]
174+
passed = run_command(retry_command)
178175

179176
if os.path.exists(retry_output_xml):
180177
merge_report(parallel_output_xml, retry_output_xml, output_xml,

0 commit comments

Comments
 (0)