Skip to content

Test test_broken_projections/test.py::test_broken_ignored_replicated is flaky #66835

@nikitamikhaylov

Description

@nikitamikhaylov

Describe the bug

https://s3.amazonaws.com/clickhouse-test-reports/0/2beed8c30413cd091c774c6246acfdad507f5d27/integration_tests__release__[1_4].html

Additional information

Previous attempt to fix this test was here: #61932
According to the CI database this test failed 4 times in the past 30 days, the report itself is here.

Error message and/or stacktrace

=================================== FAILURES ===================================
________________________ test_broken_ignored_replicated ________________________
[gw2] linux -- Python 3.10.12 /usr/bin/python3

cluster = <helpers.cluster.ClickHouseCluster object at 0x7f883ae82950>

    def test_broken_ignored_replicated(cluster):
        node = cluster.instances["node"]
    
        table_name = "test3"
        table_name2 = "test3_replica"
        create_table(node, table_name, 1)
    
        insert(node, table_name, 0, 5)
        insert(node, table_name, 5, 5)
        insert(node, table_name, 10, 5)
        insert(node, table_name, 15, 5)
    
        check(node, table_name, 1)
    
        create_table(node, table_name2, 2, table_name)
>       check(node, table_name2, 1)

test_broken_projections/test.py:436: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

node = <helpers.cluster.ClickHouseInstance object at 0x7f883aee40d0>
table = 'test3_replica', check_result = 1, expect_broken_part = ''
expected_error = '', do_check_command = True

    def check(
        node,
        table,
        check_result,
        expect_broken_part="",
        expected_error="",
        do_check_command=True,
    ):
        if expect_broken_part == "proj1":
            assert expected_error in node.query_and_get_error(
                f"SELECT c FROM '{table}' WHERE d == 12 ORDER BY c SETTINGS force_optimize_projection_name = 'proj1'"
            )
        else:
            query_id = node.query(
                f"SELECT queryID() FROM (SELECT c FROM '{table}' WHERE d == 12 ORDER BY c SETTINGS force_optimize_projection_name = 'proj1')"
            ).strip()
            for _ in range(10):
                node.query("SYSTEM FLUSH LOGS")
                res = node.query(
                    f"""
                SELECT query, splitByChar('.', arrayJoin(projections))[-1]
                FROM system.query_log
                WHERE query_id='{query_id}' AND type='QueryFinish'
                """
                )
                if res != "":
                    break
            if res == "":
                res = node.query(
                    """
                    SELECT query_id, query, splitByChar('.', arrayJoin(projections))[-1]
                    FROM system.query_log ORDER BY query_start_time_microseconds DESC
                """
                )
                print(f"Looked for query id {query_id}, but to no avail: {res}")
>               assert False
E               assert False

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky testflaky test found by CItestingSpecial issue with list of bugs found by CI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions