Merge pull request #68072 from ClickHouse/pufit/fix-02572_query_views_log_background_thread

Fix flaky 02572_query_views_log_background_thread
This commit is contained in:
pufit 2024-08-09 04:42:46 +00:00 committed by GitHub
commit 03c1e7e3c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,13 +13,16 @@ ${CLICKHOUSE_CLIENT} --ignore-error --multiquery --query "drop table if exists b
${CLICKHOUSE_CLIENT} --query="create table copy_02572 (key Int) engine=Memory();"
${CLICKHOUSE_CLIENT} --query="create table data_02572 (key Int) engine=Memory();"
${CLICKHOUSE_CLIENT} --query="create table buffer_02572 (key Int) engine=Buffer(currentDatabase(), data_02572, 1, 3, 3, 1, 1e9, 1, 1e9);"
${CLICKHOUSE_CLIENT} --query="create table buffer_02572 (key Int) engine=Buffer(currentDatabase(), data_02572, 1, 8, 8, 1, 1e9, 1, 1e9);"
${CLICKHOUSE_CLIENT} --query="create materialized view mv_02572 to copy_02572 as select * from data_02572;"
start=$(date +%s)
${CLICKHOUSE_CLIENT} --query="insert into buffer_02572 values (1);"
# ensure that the flush was not direct
${CLICKHOUSE_CLIENT} --ignore-error --multiquery --query "select * from data_02572; select * from copy_02572;"
if [ $(( $(date +%s) - start )) -gt 6 ]; then # clickhouse test cluster is overloaded, will skip
# ensure that the flush was not direct
${CLICKHOUSE_CLIENT} --ignore-error --multiquery --query "select * from data_02572; select * from copy_02572;"
fi
# we cannot use OPTIMIZE, this will attach query context, so let's wait
for _ in {1..100}; do