Make test_MemoryTracking::test_http not flaky

By comparing only megabytes in the memory changes, instead of bytes as
before, since it may be tricky at least due to max_untracked_memory and
how thread pool handle it.

It should be safe, since originally it was written in #16121 which fixes
issue #15932, which has ~4MB consumption of memory per request.
This commit is contained in:
Azat Khuzhin 2021-10-13 23:45:45 +03:00
parent 56ab0e31e6
commit d030e08d05

View File

@ -57,6 +57,8 @@ def get_MemoryTracking():
return int(http_query("SELECT value FROM system.metrics WHERE metric = 'MemoryTracking'"))
def check_memory(memory):
# bytes -> megabytes
memory = [*map(lambda x: int(int(x)/1024/1024), memory)]
# 3 changes to MemoryTracking is minimum, since:
# - this is not that high to not detect inacuracy
# - memory can go like X/X+N due to some background allocations