From d33a634014e85bb87a88cf1464febae908b211c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Fri, 6 Aug 2021 16:12:59 +0200 Subject: [PATCH] Improve 00738_lock_for_inner_table stability A sufficiently fast machine would finish processing the MV before the drop --- tests/queries/0_stateless/00738_lock_for_inner_table.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/00738_lock_for_inner_table.sh b/tests/queries/0_stateless/00738_lock_for_inner_table.sh index d19288f65d8..6cbed42baea 100755 --- a/tests/queries/0_stateless/00738_lock_for_inner_table.sh +++ b/tests/queries/0_stateless/00738_lock_for_inner_table.sh @@ -14,7 +14,8 @@ DROP TABLE IF EXISTS mv SYNC; -- create table with fsync and 20 partitions for slower INSERT -- (since increasing number of records will make it significantly slower in debug build, but not in release) CREATE TABLE tab_00738(a Int) ENGINE = MergeTree() ORDER BY a PARTITION BY a%20 SETTINGS fsync_after_insert=1; -CREATE MATERIALIZED VIEW mv UUID '$uuid' ENGINE = Log AS SELECT a FROM tab_00738;" | ${CLICKHOUSE_CLIENT} -n +-- The matview will take at least 2 seconds to be finished (10000000 * 0.0000002) +CREATE MATERIALIZED VIEW mv UUID '$uuid' ENGINE = Log AS SELECT sleepEachRow(0.0000002) FROM tab_00738;" | ${CLICKHOUSE_CLIENT} -n ${CLICKHOUSE_CLIENT} --query_id insert_$CLICKHOUSE_DATABASE --query "INSERT INTO tab_00738 SELECT number FROM numbers(10000000)" &