diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index 0152f9c5cfd..1f8d612a125 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -211,6 +211,9 @@ TESTS_TO_SKIP=( # to make some progress. 00646_url_engine 00974_query_profiler + + # Look at DistributedFilesToInsert, so cannot run in parallel. + 01460_DistributedFilesToInsert ) clickhouse-test -j 4 --no-long --testname --shard --zookeeper --skip "${TESTS_TO_SKIP[@]}" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee /test_output/test_log.txt diff --git a/tests/queries/0_stateless/01460_DistributedFilesToInsert.reference b/tests/queries/0_stateless/01460_DistributedFilesToInsert.reference new file mode 100644 index 00000000000..7a123a39978 --- /dev/null +++ b/tests/queries/0_stateless/01460_DistributedFilesToInsert.reference @@ -0,0 +1,12 @@ +INSERT +0 +0 +STOP/START DISTRIBUTED SENDS +1 +0 +FLUSH DISTRIBUTED +1 +0 +DROP TABLE +1 +0 diff --git a/tests/queries/0_stateless/01460_DistributedFilesToInsert.sql b/tests/queries/0_stateless/01460_DistributedFilesToInsert.sql new file mode 100644 index 00000000000..8ce10cf133f --- /dev/null +++ b/tests/queries/0_stateless/01460_DistributedFilesToInsert.sql @@ -0,0 +1,42 @@ +-- otherwise SYSTEM STOP DISTRIBUTED SENDS does not makes any effect (for localhost) +-- (i.e. no .bin files and hence no sending is required) +set prefer_localhost_replica=0; + +set distributed_directory_monitor_sleep_time_ms=50; + +drop table if exists data_01460; +drop table if exists dist_01460; + +create table data_01460 as system.one engine=Null(); +create table dist_01460 as data_01460 engine=Distributed(test_shard_localhost, currentDatabase(), data_01460); + +select 'INSERT'; +select value from system.metrics where metric = 'DistributedFilesToInsert'; +insert into dist_01460 select * from system.one; +select sleep(1) format Null; -- distributed_directory_monitor_sleep_time_ms +select value from system.metrics where metric = 'DistributedFilesToInsert'; + +select 'STOP/START DISTRIBUTED SENDS'; +system stop distributed sends dist_01460; +insert into dist_01460 select * from system.one; +select sleep(1) format Null; -- distributed_directory_monitor_sleep_time_ms +select value from system.metrics where metric = 'DistributedFilesToInsert'; +system start distributed sends dist_01460; +select sleep(1) format Null; -- distributed_directory_monitor_sleep_time_ms +select value from system.metrics where metric = 'DistributedFilesToInsert'; + +select 'FLUSH DISTRIBUTED'; +system stop distributed sends dist_01460; +insert into dist_01460 select * from system.one; +select sleep(1) format Null; -- distributed_directory_monitor_sleep_time_ms +select value from system.metrics where metric = 'DistributedFilesToInsert'; +system flush distributed dist_01460; +select value from system.metrics where metric = 'DistributedFilesToInsert'; + +select 'DROP TABLE'; +system stop distributed sends dist_01460; +insert into dist_01460 select * from system.one; +select sleep(1) format Null; -- distributed_directory_monitor_sleep_time_ms +select value from system.metrics where metric = 'DistributedFilesToInsert'; +drop table dist_01460; +select value from system.metrics where metric = 'DistributedFilesToInsert';