From 56abd3d5019f20ee5876ad785973ea7584ac0e08 Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Tue, 19 Oct 2021 15:07:46 +0300 Subject: [PATCH] Increase parallelism --- .circleci/config.yml | 8 ++++++- .../citus_arbitrary_configs.py | 6 +---- src/test/regress/citus_tests/config.py | 11 +++++++++ .../regress/citus_tests/print_test_names.py | 23 +++++++++++++++++++ 4 files changed, 42 insertions(+), 6 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..67c746a6f 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,14 @@ jobs: - run: name: 'Test arbitrary configs' command: | + TESTS=$(src/test/regress/citus_tests/print_test_names.py | circleci tests split) + # Our test suite expects comma separated values + TESTS=$(echo $TESTS | tr ' ' ',') + # TESTS will contain subset of configs that will be run on a container and we use multiple containers + # to run the test suite 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/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..b5f71f945 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 @@ -25,7 +25,6 @@ import concurrent.futures import multiprocessing from docopt import docopt import time -import inspect import random @@ -173,10 +172,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..ca86497b7 --- /dev/null +++ b/src/test/regress/citus_tests/print_test_names.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import config as cfg + + +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()