From fe9bd0e9181948a7a645b6bae7c84d5715be383b Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 29 May 2020 23:37:14 +0300 Subject: [PATCH] Added a test for #5732 --- .../01290_max_execution_speed_distributed.reference | 4 ++++ .../01290_max_execution_speed_distributed.sql | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/queries/0_stateless/01290_max_execution_speed_distributed.reference create mode 100644 tests/queries/0_stateless/01290_max_execution_speed_distributed.sql diff --git a/tests/queries/0_stateless/01290_max_execution_speed_distributed.reference b/tests/queries/0_stateless/01290_max_execution_speed_distributed.reference new file mode 100644 index 00000000000..48355e41fe4 --- /dev/null +++ b/tests/queries/0_stateless/01290_max_execution_speed_distributed.reference @@ -0,0 +1,4 @@ +2000000 +1 +1 +0 diff --git a/tests/queries/0_stateless/01290_max_execution_speed_distributed.sql b/tests/queries/0_stateless/01290_max_execution_speed_distributed.sql new file mode 100644 index 00000000000..8282390ca90 --- /dev/null +++ b/tests/queries/0_stateless/01290_max_execution_speed_distributed.sql @@ -0,0 +1,13 @@ +SET max_execution_speed = 1000000, timeout_before_checking_execution_speed = 0.001, max_block_size = 100; + +CREATE TEMPORARY TABLE times (t DateTime); + +INSERT INTO times SELECT now(); +SELECT count('special query for 01290_max_execution_speed_distributed') FROM remote('127.0.0.{2,3}', numbers(1000000)); +INSERT INTO times SELECT now(); + +SELECT max(t) - min(t) >= 1 FROM times; + +-- Check that the query was also throttled on "remote" servers. +SYSTEM FLUSH LOGS; +SELECT DISTINCT query_duration_ms >= 500 FROM system.query_log WHERE event_date >= yesterday() AND query LIKE '%special query for 01290_max_execution_speed_distributed%' AND type = 2;