mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 17:20:50 +00:00
Merge pull request #32163 from azat/clickhouse-test-random
clickhouse-test: do not use random generator with shared state
This commit is contained in:
commit
b7fb21e6f0
@ -371,9 +371,10 @@ class TestCase:
|
||||
else:
|
||||
# If --database is not specified, we will create temporary database with unique name
|
||||
# And we will recreate and drop it for each test
|
||||
def random_str(length=8):
|
||||
def random_str(length=6):
|
||||
alphabet = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(alphabet) for _ in range(length))
|
||||
# NOTE: it is important not to use default random generator, since it shares state.
|
||||
return ''.join(random.SystemRandom().choice(alphabet) for _ in range(length))
|
||||
|
||||
database = 'test_{suffix}'.format(suffix=random_str())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user