mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #30150 from azat/test_MemoryTracking-flap
Make test_MemoryTracking::test_http not flaky
This commit is contained in:
commit
9a57fbc9e8
@ -2,6 +2,17 @@
|
||||
# pylint: disable=redefined-outer-name
|
||||
# pylint: disable=line-too-long
|
||||
|
||||
# This test verifies that memory tracking does not have significant drift,
|
||||
# in other words, every allocation should be taken into account at the global
|
||||
# memory tracker.
|
||||
#
|
||||
# So we are running some queries with GROUP BY to make some allocations,
|
||||
# and after we are checking MemoryTracking metric from system.metrics,
|
||||
# and check that it does not changes too frequently.
|
||||
#
|
||||
# Also note, that syncing MemoryTracking with RSS had been disabled in
|
||||
# asynchronous_metrics_update_period_s.xml.
|
||||
|
||||
import logging
|
||||
import pytest
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
@ -46,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
|
||||
|
Loading…
Reference in New Issue
Block a user