Merge pull request #67027 from ClickHouse/fix-flaky-integration-tests

Integration tests: fix flaky tests `test_backup_restore_on_cluster/test_concurrency.py` & `test_manipulate_statistics/test.py`
This commit is contained in:
Nikita Fomichev 2024-07-25 07:50:17 +00:00 committed by GitHub
commit e1f89f41f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 16 deletions

View File

@ -147,7 +147,7 @@ static std::initializer_list<std::pair<ClickHouseVersion, SettingsChangesHistory
{"default_table_engine", "None", "MergeTree", "Set default table engine to MergeTree for better usability"},
{"input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects", false, false, "Allow to use String type for ambiguous paths during named tuple inference from JSON objects"},
{"traverse_shadow_remote_data_paths", false, false, "Traverse shadow directory when query system.remote_data_paths."},
{"throw_if_deduplication_in_dependent_materialized_views_enabled_with_async_insert", false, true, "Deduplication is dependent materialized view cannot work together with async inserts."},
{"throw_if_deduplication_in_dependent_materialized_views_enabled_with_async_insert", false, true, "Deduplication in dependent materialized view cannot work together with async inserts."},
{"parallel_replicas_allow_in_with_subquery", false, true, "If true, subquery for IN will be executed on every follower replica"},
{"log_processors_profiles", false, true, "Enable by default"},
{"function_locate_has_mysql_compatible_argument_order", false, true, "Increase compatibility with MySQL's locate function."},

View File

@ -1048,14 +1048,14 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
/// In case when the client had to retry some mini-INSERTs then they will be properly deduplicated
/// by the source tables. This functionality is controlled by a setting `async_insert_deduplicate`.
/// But then they will be glued together into a block and pushed through a chain of Materialized Views if any.
/// The process of forming such blocks is not deteministic so each time we retry mini-INSERTs the resulting
/// The process of forming such blocks is not deterministic so each time we retry mini-INSERTs the resulting
/// block may be concatenated differently.
/// That's why deduplication in dependent Materialized Views doesn't make sense in presence of async INSERTs.
if (settings.throw_if_deduplication_in_dependent_materialized_views_enabled_with_async_insert &&
settings.deduplicate_blocks_in_dependent_materialized_views)
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED,
"Deduplication is dependent materialized view cannot work together with async inserts. "\
"Please disable eiher `deduplicate_blocks_in_dependent_materialized_views` or `async_insert` setting.");
"Deduplication in dependent materialized view cannot work together with async inserts. "\
"Please disable either `deduplicate_blocks_in_dependent_materialized_views` or `async_insert` setting.");
quota = context->getQuota();
if (quota)

View File

@ -963,8 +963,8 @@ void TCPHandler::processInsertQuery()
if (settings.throw_if_deduplication_in_dependent_materialized_views_enabled_with_async_insert &&
settings.deduplicate_blocks_in_dependent_materialized_views)
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED,
"Deduplication is dependent materialized view cannot work together with async inserts. "\
"Please disable eiher `deduplicate_blocks_in_dependent_materialized_views` or `async_insert` setting.");
"Deduplication in dependent materialized view cannot work together with async inserts. "\
"Please disable either `deduplicate_blocks_in_dependent_materialized_views` or `async_insert` setting.");
auto result = processAsyncInsertQuery(*insert_queue);
if (result.status == AsynchronousInsertQueue::PushResult::OK)

View File

@ -276,15 +276,10 @@ def test_create_or_drop_tables_during_backup(db_engine, table_engine):
for node in nodes:
assert_eq_with_retry(
node,
f"SELECT status from system.backups WHERE id IN {ids_list} AND (status == 'CREATING_BACKUP')",
"",
)
for node in nodes:
assert_eq_with_retry(
node,
f"SELECT status, error from system.backups WHERE id IN {ids_list} AND (status == 'BACKUP_FAILED')",
f"SELECT status, error from system.backups "
f"WHERE id IN {ids_list} AND ((status == 'CREATING_BACKUP') OR (status == 'BACKUP_FAILED'))",
"",
retry_count=100,
)
backup_names = {}

View File

@ -167,7 +167,8 @@ def test_replicated_table_ddl(started_cluster):
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_1", "c", False)
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_1", "d", True)
node1.query(
"ALTER TABLE test_stat CLEAR STATISTICS d", settings={"alter_sync": "2"}
"ALTER TABLE test_stat CLEAR STATISTICS d",
settings={"alter_sync": "2", "mutations_sync": 2},
)
node1.query(
"ALTER TABLE test_stat ADD STATISTICS b type tdigest",
@ -177,7 +178,8 @@ def test_replicated_table_ddl(started_cluster):
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_2", "b", False)
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_2", "d", False)
node1.query(
"ALTER TABLE test_stat MATERIALIZE STATISTICS b", settings={"alter_sync": "2"}
"ALTER TABLE test_stat MATERIALIZE STATISTICS b",
settings={"alter_sync": "2", "mutations_sync": 2},
)
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_3", "a", True)
check_stat_file_on_disk(node2, "test_stat", "all_0_0_0_3", "b", True)