diff --git a/tests/sqllogic/connection.py b/tests/sqllogic/connection.py index 66e03b25cb48..24b0ff0d0ddd 100644 --- a/tests/sqllogic/connection.py +++ b/tests/sqllogic/connection.py @@ -103,6 +103,7 @@ def default_clickhouse_native_conn_args(): "max_bytes_before_external_sort": 128 * 1024 * 1024, "max_bytes_ratio_before_external_group_by": 0.0, "max_bytes_ratio_before_external_sort": 0.0, + "max_threads": 1, } ) diff --git a/tests/sqllogic/runner.py b/tests/sqllogic/runner.py index 5b7b4dd9f2e2..bd4c9818f53f 100755 --- a/tests/sqllogic/runner.py +++ b/tests/sqllogic/runner.py @@ -142,7 +142,9 @@ def _child_process(setup_kwargs, runner_kwargs, input_dir, output_dir, test): def run_all_tests_in_parallel(setup_kwargs, runner_kwargs, input_dir, output_dir): - process_count = max(1, os.cpu_count() - 4) + cpu_count = os.cpu_count() or 2 + process_count = max(1, min(10, cpu_count - 4)) + logger.info("Running tests with %s worker processes (cpu_count=%s)", process_count, cpu_count) tests = list(TestRunner.list_tests(input_dir)) with multiprocessing.Pool(process_count) as pool: async_results = [