From abff15dd7c2a64ae15d06679080653aa056a3269 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 20 Jul 2022 15:04:24 +0300 Subject: [PATCH] Fix test to be more robust with slow pageserver. If the WAL arrives at the pageserver slowly, it's possible that the branch is created before all the data on the parent branch have arrived. That results in a failure: test_runner/batch_others/test_tenant_relocation.py:259: in test_tenant_relocation timeline_id_second, current_lsn_second = populate_branch(pg_second, create_table=False, expected_sum=1001000) test_runner/batch_others/test_tenant_relocation.py:133: in populate_branch assert cur.fetchone() == (expected_sum, ) E assert (500500,) == (1001000,) E At index 0 diff: 500500 != 1001000 E Full diff: E - (1001000,) E + (500500,) To fix, specify the LSN to branch at, so that the pageserver will wait for it arrive. See https://github.com/neondatabase/neon/issues/2063 --- test_runner/batch_others/test_tenant_relocation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test_runner/batch_others/test_tenant_relocation.py b/test_runner/batch_others/test_tenant_relocation.py index 73f6f52e72..d59f28bcc5 100644 --- a/test_runner/batch_others/test_tenant_relocation.py +++ b/test_runner/batch_others/test_tenant_relocation.py @@ -26,7 +26,7 @@ from fixtures.neon_fixtures import ( wait_for_upload, wait_until, ) -from fixtures.utils import lsn_from_hex, subprocess_capture +from fixtures.utils import lsn_from_hex, lsn_to_hex, subprocess_capture def assert_abs_margin_ratio(a: float, b: float, margin_ratio: float): @@ -268,6 +268,7 @@ def test_tenant_relocation(neon_env_builder: NeonEnvBuilder, env.neon_cli.create_branch( new_branch_name="test_tenant_relocation_second", ancestor_branch_name="test_tenant_relocation_main", + ancestor_start_lsn=lsn_to_hex(current_lsn_main), tenant_id=tenant_id, ) pg_second = env.postgres.create_start(branch_name='test_tenant_relocation_second',