From a5103d00924779c2013c985bee09c2a165db0b24 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Mon, 18 Nov 2019 16:56:00 +0300 Subject: [PATCH] test.py: move args.repeat processing to find_tests() It somewhat stands in the way of using asyncio This patch also implements a more comprehensive fix for #5303, since we not only have --repeat, but run some tests in different configurations, in which case xml output is also overwritten. --- test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index cf4aa47d9b..dfef807fd4 100755 --- a/test.py +++ b/test.py @@ -301,6 +301,8 @@ def find_tests(args): print("Test {} not found".format(args.name)) sys.exit(1) + tests_to_run = [t for t in tests_to_run for _ in range(args.repeat)] + return tests_to_run @@ -313,8 +315,7 @@ def run_all_tests(tests_to_run, args): path = test[0] test_type = test[1] exec_args = test[2] if len(test) >= 3 else [] - for repeat in range(args.repeat): - futures.append(executor.submit(run_test, path, repeat, test_type, args, exec_args)) + futures.append(executor.submit(run_test, path, n, test_type, args, exec_args)) results = [] cookie = len(futures)