mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Check that functional tests cleanup their tables
This commit is contained in:
parent
ab93967fb4
commit
de0837fe21
@ -1212,7 +1212,20 @@ class TestCase:
|
||||
seconds_left = max(
|
||||
args.timeout - (datetime.now() - start_time).total_seconds(), 20
|
||||
)
|
||||
drop_database_query = "DROP DATABASE IF EXISTS " + database
|
||||
|
||||
leftover_tables = clickhouse_execute(
|
||||
args,
|
||||
f"SHOW TABLES FROM {database}",
|
||||
timeout=seconds_left,
|
||||
settings={
|
||||
"log_comment": args.testcase_basename,
|
||||
},
|
||||
).decode().replace("\n", ", ");
|
||||
|
||||
if 0 != len(leftover_tables):
|
||||
raise Exception(f"The test should cleanup its tables ({leftover_tables}), otherwise it is inconvenient for running it locally.")
|
||||
|
||||
drop_database_query = f"DROP DATABASE IF EXISTS {database}"
|
||||
if args.replicated_database:
|
||||
drop_database_query += " ON CLUSTER test_cluster_database_replicated"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
DROP TABLE IF EXISTS session_events;
|
||||
DROP TABLE IF EXISTS event_types;
|
||||
|
||||
CREATE TABLE session_events
|
||||
(
|
||||
clientId UInt64,
|
||||
@ -75,3 +78,6 @@ FROM
|
||||
WHERE runningDifference(timestamp) >= 500
|
||||
ORDER BY timestamp ASC
|
||||
FORMAT Null;
|
||||
|
||||
DROP TABLE session_events;
|
||||
DROP TABLE event_types;
|
||||
|
Loading…
Reference in New Issue
Block a user