From 69ea2776e92ef39a5f6453b6df42ab9c3aa2f957 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 30 Sep 2024 17:56:40 +0300 Subject: [PATCH] tests: Remove creation of extra timelines in some tests neon_cli.create_tenant() creates a new tenant *and* a timeline on the tenant, with name "main". In most tests, there's no need to create another timeline on the same tenant. There are some more tests that do that, but in the remaining cases, I wasn't be 100% if the presence of extra root timelines affect what the tests test, so I left them alone. --- test_runner/regress/test_branch_and_gc.py | 7 +++---- test_runner/regress/test_pageserver_restart.py | 3 +-- test_runner/regress/test_tenants_with_remote_storage.py | 3 +-- test_runner/regress/test_truncate.py | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/test_runner/regress/test_branch_and_gc.py b/test_runner/regress/test_branch_and_gc.py index d7c4cf059a..43140c05ff 100644 --- a/test_runner/regress/test_branch_and_gc.py +++ b/test_runner/regress/test_branch_and_gc.py @@ -53,7 +53,7 @@ def test_branch_and_gc(neon_simple_env: NeonEnv, build_type: str): env = neon_simple_env pageserver_http_client = env.pageserver.http_client() - tenant, _ = env.neon_cli.create_tenant( + tenant, timeline_main = env.neon_cli.create_tenant( conf={ # disable background GC "gc_period": "0s", @@ -70,8 +70,7 @@ def test_branch_and_gc(neon_simple_env: NeonEnv, build_type: str): } ) - timeline_main = env.neon_cli.create_timeline("test_main", tenant_id=tenant) - endpoint_main = env.endpoints.create_start("test_main", tenant_id=tenant) + endpoint_main = env.endpoints.create_start("main", tenant_id=tenant) main_cur = endpoint_main.connect().cursor() @@ -92,7 +91,7 @@ def test_branch_and_gc(neon_simple_env: NeonEnv, build_type: str): pageserver_http_client.timeline_gc(tenant, timeline_main, lsn2 - lsn1 + 1024) env.neon_cli.create_branch( - "test_branch", "test_main", tenant_id=tenant, ancestor_start_lsn=lsn1 + "test_branch", ancestor_branch_name="main", ancestor_start_lsn=lsn1, tenant_id=tenant ) endpoint_branch = env.endpoints.create_start("test_branch", tenant_id=tenant) diff --git a/test_runner/regress/test_pageserver_restart.py b/test_runner/regress/test_pageserver_restart.py index bbf82fea4c..bd47a30428 100644 --- a/test_runner/regress/test_pageserver_restart.py +++ b/test_runner/regress/test_pageserver_restart.py @@ -174,8 +174,7 @@ def test_pageserver_chaos( "checkpoint_distance": "5000000", } ) - env.neon_cli.create_timeline("test_pageserver_chaos", tenant_id=tenant) - endpoint = env.endpoints.create_start("test_pageserver_chaos", tenant_id=tenant) + endpoint = env.endpoints.create_start("main", tenant_id=tenant) # Create table, and insert some rows. Make it big enough that it doesn't fit in # shared_buffers, otherwise the SELECT after restart will just return answer diff --git a/test_runner/regress/test_tenants_with_remote_storage.py b/test_runner/regress/test_tenants_with_remote_storage.py index 168876b711..6ecc903192 100644 --- a/test_runner/regress/test_tenants_with_remote_storage.py +++ b/test_runner/regress/test_tenants_with_remote_storage.py @@ -71,10 +71,9 @@ def test_tenants_many(neon_env_builder: NeonEnvBuilder): "checkpoint_distance": "5000000", } ) - env.neon_cli.create_timeline("test_tenants_many", tenant_id=tenant) endpoint = env.endpoints.create_start( - "test_tenants_many", + "main", tenant_id=tenant, ) tenants_endpoints.append((tenant, endpoint)) diff --git a/test_runner/regress/test_truncate.py b/test_runner/regress/test_truncate.py index 52f125ce0b..bfa9ce5db7 100644 --- a/test_runner/regress/test_truncate.py +++ b/test_runner/regress/test_truncate.py @@ -26,8 +26,7 @@ def test_truncate(neon_env_builder: NeonEnvBuilder, zenbenchmark): } ) - env.neon_cli.create_timeline("test_truncate", tenant_id=tenant) - endpoint = env.endpoints.create_start("test_truncate", tenant_id=tenant) + endpoint = env.endpoints.create_start("main", tenant_id=tenant) cur = endpoint.connect().cursor() cur.execute("create table t1(x integer)") cur.execute(f"insert into t1 values (generate_series(1,{n_records}))")