mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Add test_cgroup_metrics/ to verify that CGroupUserTime and CGroupSystemTime metrics are correctly collected when ClickHouse runs in a cgroup v2 environment with a nested cgroup path. The test detects the bug in src/Common/AsynchronousMetrics.cpp:119 where openCgroupv2MetricFile incorrectly concatenates the cgroup path with the filename using string addition instead of proper path operations. This causes paths like '/sys/fs/cgroup/docker/abc' + 'cpu.stat' to produce '/sys/fs/cgroup/docker/abccpu.stat' instead of the correct '/sys/fs/cgroup/docker/abc/cpu.stat'. The test: - Uses pytest.skip() when cgroup v2 is not available (proper CI reporting) - Uses retry/poll loops instead of fixed sleeps for metric collection - Queries system.asynchronous_metrics for CGroupUserTime and CGroupSystemTime - Asserts the metrics exist and have non-negative values - Verifies CPU time increases by at least 1ms after CPU-intensive work If the path concatenation bug is present, the metrics will not be reported and the test will fail.
0 lines
0 B
Python
0 lines
0 B
Python
The file is empty.