From 26c2f32b21c500121e62f6988688b94b3a72c07c Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Mon, 18 Oct 2021 13:43:57 +0300 Subject: [PATCH] Increase parallelism --- .circleci/config.yml | 5 +++- .gitignore | 3 +++ .../citus_arbitrary_configs.py | 5 +--- src/test/regress/citus_tests/config.py | 11 +++++++++ .../regress/citus_tests/print_test_names.py | 24 +++++++++++++++++++ 5 files changed, 43 insertions(+), 5 deletions(-) create mode 100755 src/test/regress/citus_tests/print_test_names.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 95fb34696..2a0b950c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,6 +171,7 @@ jobs: test-arbitrary-configs: description: Runs tests on arbitrary configs + parallelism: 6 parameters: pg_major: description: 'postgres major version to use' @@ -207,9 +208,11 @@ jobs: - run: name: 'Test arbitrary configs' command: | + TESTS=$(src/test/regress/citus_tests/print_test_names.py | circleci tests split) + TESTS=$(echo $TESTS | tr ' ' ',') gosu circleci \ make -C src/test/regress \ - check-arbitrary-configs parallel=4 + check-arbitrary-configs parallel=4 CONFIGS=$TESTS no_output_timeout: 2m - run: name: 'Show regressions' diff --git a/.gitignore b/.gitignore index 33f5549f3..bcf5059d2 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ lib*.pc # style related temporary outputs *.uncrustify + +# auto generated tests +tests.txt diff --git a/src/test/regress/citus_tests/arbitrary_configs/citus_arbitrary_configs.py b/src/test/regress/citus_tests/arbitrary_configs/citus_arbitrary_configs.py index 9d00fe290..3f4a7cd70 100755 --- a/src/test/regress/citus_tests/arbitrary_configs/citus_arbitrary_configs.py +++ b/src/test/regress/citus_tests/arbitrary_configs/citus_arbitrary_configs.py @@ -173,10 +173,7 @@ def read_configs(docoptRes): # We fill the configs from all of the possible classes in config.py so that if we add a new config, # we don't need to add it here. And this avoids the problem where we forget to add it here for x in cfg.__dict__.values(): - if inspect.isclass(x) and ( - issubclass(x, cfg.CitusMXBaseClusterConfig) - or issubclass(x, cfg.CitusDefaultClusterConfig) - ): + if cfg.should_include_config(x): configs.append(x(docoptRes)) return configs diff --git a/src/test/regress/citus_tests/config.py b/src/test/regress/citus_tests/config.py index 0f1530fc5..b4bdb9991 100644 --- a/src/test/regress/citus_tests/config.py +++ b/src/test/regress/citus_tests/config.py @@ -5,6 +5,7 @@ from contextlib import closing import os import threading import common +import inspect COORDINATOR_NAME = "coordinator" WORKER1 = "worker1" @@ -55,6 +56,16 @@ PORT_UPPER = 32768 port_lock = threading.Lock() +def should_include_config(class_name): + + if inspect.isclass(class_name) and ( + issubclass(class_name, CitusMXBaseClusterConfig) + or issubclass(class_name, CitusDefaultClusterConfig) + ): + return True + return False + + def find_free_port(): global next_port with port_lock: diff --git a/src/test/regress/citus_tests/print_test_names.py b/src/test/regress/citus_tests/print_test_names.py new file mode 100755 index 000000000..7de76244e --- /dev/null +++ b/src/test/regress/citus_tests/print_test_names.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import config as cfg +import inspect + + +def read_config_names(): + config_names = [] + # We fill the configs from all of the possible classes in config.py so that if we add a new config, + # we don't need to add it here. And this avoids the problem where we forget to add it here + for x in cfg.__dict__.values(): + if cfg.should_include_config(x): + config_names.append(x.__name__) + return config_names + + +def print_config_names(): + config_names = read_config_names() + for config_name in config_names: + print(config_name) + + +if __name__ == "__main__": + print_config_names()