Merge pull request #15236 from ClickHouse/run_func_tests_in_parallel

Collect list of non-parallel test
This commit is contained in:
alesapin 2020-12-16 19:29:32 +03:00 committed by GitHub
commit d873439846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 218 additions and 9 deletions

View File

@ -580,6 +580,9 @@ def main(args):
else:
args.skip = tests_to_skip_from_list
if args.use_skip_list and not args.sequential:
args.sequential = collect_sequential_list(args.skip_list_path)
base_dir = os.path.abspath(args.queries)
tmp_dir = os.path.abspath(args.tmp)
@ -693,10 +696,19 @@ def main(args):
all_tests = [t for t in all_tests if any([re.search(r, t) for r in args.test])]
all_tests.sort(key=key_func)
parallel_tests = []
sequential_tests = []
for test in all_tests:
if any(s in test for s in args.sequential):
sequential_tests.append(test)
else:
parallel_tests.append(test)
print("Found", len(parallel_tests), "parallel tests and", len(sequential_tests), "sequential tests")
run_n, run_total = args.parallel.split('/')
run_n = float(run_n)
run_total = float(run_total)
tests_n = len(all_tests)
tests_n = len(parallel_tests)
if run_total > tests_n:
run_total = tests_n
if run_n > run_total:
@ -708,18 +720,20 @@ def main(args):
if jobs > run_total:
run_total = jobs
batch_size = len(all_tests) // jobs
all_tests_array = []
for i in range(0, len(all_tests), batch_size):
all_tests_array.append((all_tests[i:i+batch_size], suite, suite_dir, suite_tmp_dir, run_total))
batch_size = len(parallel_tests) // jobs
parallel_tests_array = []
for i in range(0, len(parallel_tests), batch_size):
parallel_tests_array.append((parallel_tests[i:i+batch_size], suite, suite_dir, suite_tmp_dir, run_total))
if jobs > 1:
with closing(multiprocessing.Pool(processes=jobs)) as pool:
pool.map(run_tests_array, all_tests_array)
else:
run_tests_array(all_tests_array[int(run_n)-1])
pool.map(run_tests_array, parallel_tests_array)
total_tests_run += tests_n
run_tests_array((sequential_tests, suite, suite_dir, suite_tmp_dir, run_total))
total_tests_run += len(sequential_tests) + len(parallel_tests)
else:
run_tests_array((all_tests, suite, suite_dir, suite_tmp_dir, run_total))
total_tests_run += len(all_tests)
if args.hung_check:
@ -810,6 +824,20 @@ def collect_tests_to_skip(skip_list_path, build_flags):
return result
def collect_sequential_list(skip_list_path):
if not os.path.exists(skip_list_path):
return set([])
with open(skip_list_path, 'r') as skip_list_file:
content = skip_list_file.read()
# allows to have comments in skip_list.json
skip_dict = json.loads(json_minify(content))
if 'parallel' in skip_dict:
return skip_dict['parallel']
return set([])
if __name__ == '__main__':
parser=ArgumentParser(description='ClickHouse functional tests')
parser.add_argument('-q', '--queries', help='Path to queries dir')
@ -846,6 +874,7 @@ if __name__ == '__main__':
parser.add_argument('--no-stateless', action='store_true', help='Disable all stateless tests')
parser.add_argument('--no-stateful', action='store_true', help='Disable all stateful tests')
parser.add_argument('--skip', nargs='+', help="Skip these tests")
parser.add_argument('--sequential', nargs='+', help="Run these tests sequentially even if --parallel specified")
parser.add_argument('--no-long', action='store_false', dest='no_long', help='Do not run long tests')
parser.add_argument('--client-option', nargs='+', help='Specify additional client argument')
parser.add_argument('--print-time', action='store_true', dest='print_time', help='Print test time')
@ -889,6 +918,9 @@ if __name__ == '__main__':
if args.skip_list_path is None:
args.skip_list_path = os.path.join(args.queries, 'skip_list.json')
if args.sequential is None:
args.sequential = set([])
if args.tmp is None:
args.tmp = args.queries
if args.client is None:

View File

@ -0,0 +1,4 @@
<!-- Ignore limit of concurrent queries in tests -->
<yandex>
<max_concurrent_queries>0</max_concurrent_queries>
</yandex>

View File

@ -27,6 +27,7 @@ ln -sf $SRC_PATH/config.d/secure_ports.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/clusters.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/graphite.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/database_atomic.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/max_concurrent_queries.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/test_cluster_with_incorrect_pw.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/test_keeper_port.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/logging_no_rotate.xml $DEST_SERVER_PATH/config.d/

View File

@ -106,5 +106,177 @@
"polymorphic-parts": [
"01508_partition_pruning", /// bug, shoud be fixed
"01482_move_to_prewhere_and_cast" /// bug, shoud be fixed
],
"parallel":
[
/// Pessimistic list of tests which work badly in parallel.
/// Probably they need better investigation.
"00062_replicated_merge_tree_alter_zookeeper",
"00109_shard_totals_after_having",
"00110_external_sort",
"00116_storage_set",
"00121_drop_column_zookeeper",
"00133_long_shard_memory_tracker_and_exception_safety",
"00180_attach_materialized_view",
"00226_zookeeper_deduplication_and_unexpected_parts",
"00236_replicated_drop_on_non_leader_zookeeper",
"00305_http_and_readonly",
"00311_array_primary_key",
"00417_kill_query",
"00423_storage_log_single_thread",
"00429_long_http_bufferization",
"00446_clear_column_in_partition_concurrent_zookeeper",
"00446_clear_column_in_partition_zookeeper",
"00463_long_sessions_in_http_interface",
"00505_shard_secure",
"00508_materialized_view_to",
"00516_deduplication_after_drop_partition_zookeeper",
"00534_functions_bad_arguments10",
"00552_or_nullable",
"00564_versioned_collapsing_merge_tree",
"00571_non_exist_database_when_create_materializ_view",
"00575_illegal_column_exception_when_drop_depen_column",
"00599_create_view_with_subquery",
"00612_http_max_query_size",
"00619_union_highlite",
"00620_optimize_on_nonleader_replica_zookeeper",
"00625_arrays_in_nested",
"00626_replace_partition_from_table",
"00626_replace_partition_from_table_zookeeper",
"00633_materialized_view_and_too_many_parts_zookeeper",
"00652_mergetree_mutations",
"00652_replicated_mutations_zookeeper",
"00682_empty_parts_merge",
"00688_low_cardinality_serialization",
"00693_max_block_size_system_tables_columns",
"00699_materialized_view_mutations",
"00701_rollup",
"00715_fetch_merged_or_mutated_part_zookeeper",
"00751_default_databasename_for_view",
"00753_alter_attach",
"00754_alter_modify_column_partitions",
"00754_alter_modify_order_by_replicated_zookeeper",
"00763_long_lock_buffer_alter_destination_table",
"00804_test_alter_compression_codecs",
"00804_test_custom_compression_codecs",
"00804_test_custom_compression_codes_log_storages",
"00804_test_delta_codec_compression",
"00834_cancel_http_readonly_queries_on_client_close",
"00834_kill_mutation",
"00834_kill_mutation_replicated_zookeeper",
"00840_long_concurrent_select_and_drop_deadlock",
"00899_long_attach_memory_limit",
"00910_zookeeper_custom_compression_codecs_replicated",
"00926_adaptive_index_granularity_merge_tree",
"00926_adaptive_index_granularity_pk",
"00926_adaptive_index_granularity_replacing_merge_tree",
"00926_zookeeper_adaptive_index_granularity_replicated_merge_tree",
"00933_alter_ttl",
"00933_reserved_word",
"00933_test_fix_extra_seek_on_compressed_cache",
"00933_ttl_replicated_zookeeper",
"00933_ttl_with_default",
"00955_test_final_mark",
"00976_ttl_with_old_parts",
"00980_merge_alter_settings",
"00980_zookeeper_merge_tree_alter_settings",
"00988_constraints_replication_zookeeper",
"00989_parallel_parts_loading",
"00993_system_parts_race_condition_drop_zookeeper",
"01013_sync_replica_timeout_zookeeper",
"01014_lazy_database_concurrent_recreate_reattach_and_show_tables",
"01015_attach_part",
"01018_ddl_dictionaries_concurrent_requrests",
"01018_ddl_dictionaries_create",
"01018_ddl_dictionaries_select",
"01021_only_tuple_columns",
"01031_mutations_interpreter_and_context",
"01033_dictionaries_lifetime",
"01035_concurrent_move_partition_from_table_zookeeper",
"01045_zookeeper_system_mutations_with_parts_names",
"01053_ssd_dictionary",
"01055_compact_parts_1",
"01060_avro",
"01060_shutdown_table_after_detach",
"01070_materialize_ttl",
"01070_modify_ttl",
"01070_mutations_with_dependencies",
"01071_live_view_detach_dependency",
"01071_prohibition_secondary_index_with_old_format_merge_tree",
"01073_attach_if_not_exists",
"01076_parallel_alter_replicated_zookeeper",
"01079_parallel_alter_add_drop_column_zookeeper",
"01079_parallel_alter_detach_table_zookeeper",
"01083_expressions_in_engine_arguments",
"01085_max_distributed_connections_http",
"01092_memory_profiler",
"01098_temporary_and_external_tables",
"01107_atomic_db_detach_attach",
"01108_restart_replicas_rename_deadlock_zookeeper",
"01110_dictionary_layout_without_arguments",
"01114_database_atomic",
"01127_month_partitioning_consistency_select",
"01130_in_memory_parts_partitons",
"01135_default_and_alter_zookeeper",
"01148_zookeeper_path_macros_unfolding",
"01190_full_attach_syntax",
"01193_metadata_loading",
"01200_mutations_memory_consumption",
"01238_http_memory_tracking",
"01249_bad_arguments_for_bloom_filter",
"01251_dict_is_in_infinite_loop",
"01254_dict_load_after_detach_attach",
"01259_dictionary_custom_settings_ddl",
"01267_alter_default_key_columns_zookeeper",
"01268_dictionary_direct_layout",
"01269_alias_type_differs",
"01272_suspicious_codecs",
"01277_alter_rename_column_constraint_zookeeper",
"01280_ssd_complex_key_dictionary",
"01280_ttl_where_group_by",
"01281_group_by_limit_memory_tracking",
"01281_unsucceeded_insert_select_queries_counter",
"01293_system_distribution_queue",
"01294_lazy_database_concurrent",
"01294_lazy_database_concurrent_recreate_reattach_and_show_tables",
"01305_replica_create_drop_zookeeper",
"01307_multiple_leaders_zookeeper",
"01318_long_unsuccessful_mutation_zookeeper",
"01319_manual_write_to_replicas",
"01338_long_select_and_alter",
"01338_long_select_and_alter_zookeeper",
"01355_alter_column_with_order",
"01355_ilike",
"01357_version_collapsing_attach_detach_zookeeper",
"01375_compact_parts_codecs",
"01378_alter_rename_with_ttl_zookeeper",
"01388_clear_all_columns",
"01396_inactive_replica_cleanup_nodes_zookeeper",
"01412_cache_dictionary_race",
"01414_mutations_and_errors_zookeeper",
"01415_inconsistent_merge_tree_settings",
"01415_sticking_mutations",
"01417_freeze_partition_verbose",
"01417_freeze_partition_verbose_zookeeper",
"01430_modify_sample_by_zookeeper",
"01454_storagememory_data_race_challenge",
"01456_modify_column_type_via_add_drop_update",
"01457_create_as_table_function_structure",
"01459_manual_write_to_replicas",
"01460_DistributedFilesToInsert",
"01465_ttl_recompression",
"01471_calculate_ttl_during_merge",
"01493_alter_remove_properties_zookeeper",
"01493_storage_set_persistency",
"01494_storage_join_persistency",
"01516_drop_table_stress",
"01541_max_memory_usage_for_user",
"attach",
"ddl_dictionaries",
"dictionary",
"limit_memory",
"live_view",
"memory_leak",
"memory_limit"
]
}