Skip to content

test_peak_memory_usage is flaky #87900

@azat

Description

@azat

CI:

=================================== FAILURES ===================================
___________ test_clickhouse_client_max_peak_memory_usage_distributed ___________
[gw0] linux -- Python 3.10.12 /usr/bin/python3

started_cluster = <helpers.cluster.ClickHouseCluster object at 0xff66859c0d30>

    def test_clickhouse_client_max_peak_memory_usage_distributed(started_cluster):
        client_output = tempfile.TemporaryFile(mode="w+t")
        command_text = (
            f"{started_cluster.get_client_cmd()} --host {shard_1.ip_address} --port 9000"
        )
        with client(name="client1>", log=client_output, command=command_text) as client1:
            client1.expect(prompt)
            client1.send(
                "SELECT COUNT(*) FROM distributed_fixed_numbers JOIN fixed_numbers_2 ON distributed_fixed_numbers.number=fixed_numbers_2.number SETTINGS query_plan_join_swap_table = 'false', join_algorithm='hash'",
            )
            client1.expect("Peak memory usage", timeout=60)
            client1.expect(prompt)
    
        peak_memory_usage = get_memory_usage_from_client_output_and_close(client_output)
        assert peak_memory_usage
>       assert shard_2.contains_in_log(f"Query peak memory usage: {peak_memory_usage}")
E       AssertionError: assert False
E        +  where False = <bound method ClickHouseInstance.contains_in_log of <helpers.cluster.ClickHouseInstance object at 0xff66859c1300>>('Query peak memory usage: 8.24')
E        +    where <bound method ClickHouseInstance.contains_in_log of <helpers.cluster.ClickHouseInstance object at 0xff66859c1300>> = <helpers.cluster.ClickHouseInstance object at 0xff66859c1300>.contains_in_log

'�[0J�[?25hQuery id: db64f926-9dd7-417a-a714-15e7a0ba8337

...

'client1>Peak memory usage
'

'client1>: 8.24 MiB.
'

peak_memory_usage 8.24

azat:.../tmp/ci3$ grep 'db64f926-9dd7-417a-a714-15e7a0ba8337.*Query peak memory usage: ' test_peak_memory_usage/_instances-0-gw0/shard_*/logs/*.log
test_peak_memory_usage/_instances-0-gw0/shard_1/logs/clickhouse-server.log:2025.09.30 07:36:18.941208 [ 19 ] {db64f926-9dd7-417a-a714-15e7a0ba8337} <Debug> MemoryTracker: Query peak memory usage: 4.61 MiB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky testflaky test found by CI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions