mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #40876 from ClickHouse/tavplubix-patch-3
"Fix" database names collision in functional tests
This commit is contained in:
commit
71dc70bdff
@ -533,7 +533,7 @@ class TestCase:
|
|||||||
else:
|
else:
|
||||||
# If --database is not specified, we will create temporary database with
|
# If --database is not specified, we will create temporary database with
|
||||||
# unique name and we will recreate and drop it for each test
|
# unique name and we will recreate and drop it for each test
|
||||||
def random_str(length=6):
|
def random_str(length=8):
|
||||||
alphabet = string.ascii_lowercase + string.digits
|
alphabet = string.ascii_lowercase + string.digits
|
||||||
# NOTE: it is important not to use default random generator, since it shares state.
|
# NOTE: it is important not to use default random generator, since it shares state.
|
||||||
return "".join(
|
return "".join(
|
||||||
@ -995,9 +995,12 @@ class TestCase:
|
|||||||
args.timeout - (datetime.now() - start_time).total_seconds(), 20
|
args.timeout - (datetime.now() - start_time).total_seconds(), 20
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
drop_database_query = "DROP DATABASE " + database
|
||||||
|
if args.replicated_database:
|
||||||
|
drop_database_query += " ON CLUSTER test_cluster_database_replicated"
|
||||||
clickhouse_execute(
|
clickhouse_execute(
|
||||||
args,
|
args,
|
||||||
"DROP DATABASE " + database,
|
drop_database_query,
|
||||||
timeout=seconds_left,
|
timeout=seconds_left,
|
||||||
settings={
|
settings={
|
||||||
"log_comment": args.testcase_basename,
|
"log_comment": args.testcase_basename,
|
||||||
|
Loading…
Reference in New Issue
Block a user