Merge pull request #40575 from Avogar/try-fix-s3-test

Fix flaky schema inference cache tests
This commit is contained in:
Alexander Tokmakov 2022-08-24 18:24:05 +03:00 committed by GitHub
commit f68db41c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 11 deletions

View File

@ -27,7 +27,7 @@ def get_profile_event_for_query(node, query, profile_event):
query = query.replace("'", "\\'")
return int(
node.query(
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by event_time desc limit 1"
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by query_start_time_microseconds desc limit 1"
)
)

View File

@ -636,7 +636,7 @@ def get_profile_event_for_query(node, query, profile_event):
query = query.replace("'", "\\'")
return int(
node.query(
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by event_time desc limit 1"
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by query_start_time_microseconds desc limit 1"
)
)

View File

@ -1493,16 +1493,12 @@ def test_wrong_format_usage(started_cluster):
def check_profile_event_for_query(instance, query, profile_event, amount):
instance.query("system flush logs")
query = query.replace("'", "\\'")
attempt = 0
res = 0
while attempt < 10:
res = int(
instance.query(
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by event_time desc limit 1"
)
res = int(
instance.query(
f"select ProfileEvents['{profile_event}'] from system.query_log where query='{query}' and type = 'QueryFinish' order by query_start_time_microseconds desc limit 1"
)
if res == amount:
break
)
assert res == amount