2828
2929MAX_WORKERS = 4
3030TIMEOUT_PER_TEST = 300
31- RETRY_COUNT = 0
31+ RETRY_COUNT = 1
3232RETRY_DELAY = 5
3333
3434timestamp = datetime .datetime .now ().strftime ("%Y%m%d_%H%M%S" )
@@ -213,7 +213,7 @@ def load_bridge_dataset(dataset_path: str, bridge_container_name: str) -> None:
213213 )
214214
215215
216- def wait_for_server_ready (port : int , container_name : str , timeout_seconds : int = 10 ) -> None :
216+ def wait_for_server_ready (port : int , container_name : str , timeout_seconds : int = 30 ) -> None :
217217 url = f"http://localhost:{ port } /privmx-configuration.json"
218218 deadline = time .time () + timeout_seconds
219219
@@ -615,6 +615,13 @@ def parse_cli_args(argv: Sequence[str]) -> tuple[argparse.Namespace, str | None,
615615 action = "store_true" ,
616616 help = "Create/update test/.venv and install Python dependencies before running tests." ,
617617 )
618+ parser .add_argument (
619+ "--max-workers" ,
620+ type = int ,
621+ default = MAX_WORKERS ,
622+ metavar = "N" ,
623+ help = f"Maximum number of tests to run in parallel (default: { MAX_WORKERS } )." ,
624+ )
618625 parser .add_argument ("tests_dir" , nargs = "?" )
619626 parser .add_argument ("init_file_path" , nargs = "?" )
620627 parser .add_argument ("dataset_dir" , nargs = "?" )
@@ -666,6 +673,7 @@ def main(
666673 dataset_dir_path : str ,
667674 run_passthrough_args : Sequence [str ],
668675 selected_filter : str | None ,
676+ max_workers : int = MAX_WORKERS ,
669677) -> int :
670678 validate_input_paths (test_dir_path , init_file_path , dataset_dir_path )
671679
@@ -686,7 +694,7 @@ def main(
686694
687695 scheduled_tests += len (tests )
688696 print (f"Found { len (tests )} tests in { test_file } " )
689- with ThreadPoolExecutor (max_workers = MAX_WORKERS ) as executor :
697+ with ThreadPoolExecutor (max_workers = max_workers ) as executor :
690698 futures = [
691699 executor .submit (
692700 run_single_test ,
@@ -740,5 +748,6 @@ def main(
740748 dataset_dir_path ,
741749 run_passthrough_args ,
742750 selected_filter ,
751+ args .max_workers ,
743752 )
744753 raise SystemExit (0 if result == 0 else 1 )
0 commit comments