diff --git a/tests/integration/helpers/test_tools.py b/tests/integration/helpers/test_tools.py index c334a7366da..bd43adad95d 100644 --- a/tests/integration/helpers/test_tools.py +++ b/tests/integration/helpers/test_tools.py @@ -186,6 +186,7 @@ def csv_compare(result, expected): def wait_condition(func, condition, max_attempts=10, delay=0.1): attempts = 0 + result = None while attempts < max_attempts: result = func() if condition(result): @@ -194,4 +195,6 @@ def wait_condition(func, condition, max_attempts=10, delay=0.1): if attempts < max_attempts: time.sleep(delay) - raise Exception(f"Function did not satisfy condition after {max_attempts} attempts") + raise Exception( + f"Function did not satisfy condition after {max_attempts} attempts. Last result:\n{result}" + ) diff --git a/tests/integration/test_refreshable_mat_view/test.py b/tests/integration/test_refreshable_mat_view/test.py index c25d37fdc19..ed8e9de1168 100644 --- a/tests/integration/test_refreshable_mat_view/test.py +++ b/tests/integration/test_refreshable_mat_view/test.py @@ -377,8 +377,8 @@ def test_real_wait_refresh( "test_rmv", condition=lambda x: x["last_refresh_time"] == rmv["next_refresh_time"], # wait for refresh a little bit more than 10 seconds - max_attempts=12, - delay=1, + max_attempts=30, + delay=0.5, ) if append: diff --git a/tests/integration/test_refreshable_mat_view_replicated/test.py b/tests/integration/test_refreshable_mat_view_replicated/test.py index 4293a3ca23b..cf09dc9c8e1 100644 --- a/tests/integration/test_refreshable_mat_view_replicated/test.py +++ b/tests/integration/test_refreshable_mat_view_replicated/test.py @@ -221,13 +221,19 @@ def fn_setup_tables(): @pytest.mark.parametrize( "select_query", [ - "SELECT now() as a, number as b FROM numbers(2)", - "SELECT now() as a, b as b FROM src1", + "SELECT now() as a, number as b FROM numbers(2) SETTINGS insert_deduplicate=0", + "SELECT now() as a, b as b FROM src1 SETTINGS insert_deduplicate=0", ], ) -@pytest.mark.parametrize("with_append", [True, False]) -@pytest.mark.parametrize("empty", [True, False]) -def test_simple_append( +@pytest.mark.parametrize( + "with_append", + [True, False], +) +@pytest.mark.parametrize( + "empty", + [True, False], +) +def test_append( module_setup_tables, fn_setup_tables, select_query, @@ -247,8 +253,6 @@ def test_simple_append( rmv = get_rmv_info(node, "test_rmv", wait_status="Scheduled") assert rmv["exception"] is None - node.query("SYSTEM SYNC DATABASE REPLICA ON CLUSTER default default") - records = node.query("SELECT count() FROM test_rmv") if empty: @@ -256,20 +260,13 @@ def test_simple_append( else: assert records == "2\n" - for n in nodes: - n.query(f"SYSTEM TEST VIEW test_rmv SET FAKE TIME '{rmv['next_refresh_time']}'") + node.query(f"SYSTEM TEST VIEW test_rmv SET FAKE TIME '{rmv['next_refresh_time']}'") rmv2 = get_rmv_info(node, "test_rmv", wait_status="Scheduled") assert rmv2["exception"] is None - node.query("SYSTEM SYNC DATABASE REPLICA ON CLUSTER default default") - if empty: - expect = "2\n" - - if not with_append: - expect = "2\n" - + expect = "2\n" if with_append and not empty: expect = "4\n" @@ -373,6 +370,9 @@ def test_real_wait_refresh( empty, to_clause, ): + if node.is_built_with_sanitizer(): + pytest.skip("Disabled for sanitizers") + table_clause, to_clause_, tgt = to_clause create_sql = CREATE_RMV.render( @@ -380,7 +380,7 @@ def test_real_wait_refresh( refresh_interval="EVERY 10 SECOND", to_clause=to_clause_, table_clause=table_clause, - select_query="SELECT now() as a, b FROM src1", + select_query="SELECT now() as a, b FROM src1 SETTINGS insert_deduplicate=0", with_append=append, on_cluster="default", empty=empty,