From d030e08d05c3257ef9d168052d723be0105e22ac Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 13 Oct 2021 23:45:45 +0300 Subject: [PATCH] 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. --- tests/integration/test_MemoryTracking/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_MemoryTracking/test.py b/tests/integration/test_MemoryTracking/test.py index 51a7214a442..2ec5b2457af 100644 --- a/tests/integration/test_MemoryTracking/test.py +++ b/tests/integration/test_MemoryTracking/test.py @@ -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