clickhouse-test - also randomize stateless-statefull order (#4694)

This commit is contained in:
proller 2019-03-14 19:37:23 +03:00 committed by GitHub
parent e8dfa122a3
commit 2afb4438ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,7 +160,21 @@ def main(args):
clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE)
clickhouse_proc_create.communicate("CREATE DATABASE IF NOT EXISTS test")
for suite in sorted(os.listdir(base_dir)):
def sute_key_func(item):
if args.order == 'random':
return random()
if -1 == item.find('_'):
return 99998
prefix, suffix = item.split('_', 1)
try:
return int(prefix), suffix
except ValueError:
return 99997
for suite in sorted(os.listdir(base_dir), key=sute_key_func):
if SERVER_DIED:
break