remove redundant expect_tenant_to_download_timeline

This commit is contained in:
Dmitry Rodionov
2022-10-17 21:36:30 +03:00
committed by Dmitry Rodionov
parent 0ec5ddea0b
commit 129f7c82b7
2 changed files with 6 additions and 32 deletions

View File

@@ -10,8 +10,8 @@ import pytest
from fixtures.log_helper import log
from fixtures.neon_fixtures import (
NeonEnvBuilder,
NeonPageserverHttpClient,
RemoteStorageKind,
assert_no_in_progress_downloads_for_tenant,
available_remote_storages,
wait_for_last_record_lsn,
wait_for_upload,
@@ -125,7 +125,7 @@ def test_remote_storage_backup_and_restore(
wait_until(
number_of_iterations=20,
interval=1,
func=lambda: expect_tenant_to_download_timeline(client, tenant_id),
func=lambda: assert_no_in_progress_downloads_for_tenant(client, tenant_id),
)
detail = client.timeline_detail(tenant_id, timeline_id)
@@ -142,16 +142,3 @@ def test_remote_storage_backup_and_restore(
query_scalar(cur, f"SELECT secret FROM t{checkpoint_number} WHERE id = {data_id};")
== f"{data_secret}|{checkpoint_number}"
)
def expect_tenant_to_download_timeline(
client: NeonPageserverHttpClient,
tenant_id: TenantId,
):
for tenant in client.tenant_list():
if tenant["id"] == str(tenant_id):
assert not tenant.get(
"has_in_progress_downloads", True
), f"Tenant {tenant_id} should have no downloads in progress"
return
assert False, f"Tenant {tenant_id} is missing on pageserver"

View File

@@ -19,9 +19,9 @@ from fixtures.neon_fixtures import (
LocalFsStorage,
NeonEnv,
NeonEnvBuilder,
NeonPageserverHttpClient,
Postgres,
RemoteStorageKind,
assert_no_in_progress_downloads_for_tenant,
available_remote_storages,
wait_for_last_record_lsn,
wait_for_upload,
@@ -168,7 +168,7 @@ def test_tenants_attached_after_download(
wait_until(
number_of_iterations=5,
interval=1,
func=lambda: expect_tenant_to_download_timeline(client, tenant_id),
func=lambda: assert_no_in_progress_downloads_for_tenant(client, tenant_id),
)
restored_timelines = client.timeline_list(tenant_id)
@@ -181,19 +181,6 @@ def test_tenants_attached_after_download(
), f"Tenant {tenant_id} should have its old timeline {timeline_id} restored from the remote storage"
def expect_tenant_to_download_timeline(
client: NeonPageserverHttpClient,
tenant_id: TenantId,
):
for tenant in client.tenant_list():
if tenant["id"] == str(tenant_id):
assert not tenant.get(
"has_in_progress_downloads", True
), f"Tenant {tenant_id} should have no downloads in progress"
return
assert False, f"Tenant {tenant_id} is missing on pageserver"
@pytest.mark.parametrize("remote_storage_kind", [RemoteStorageKind.LOCAL_FS])
def test_tenant_upgrades_index_json_from_v0(
neon_env_builder: NeonEnvBuilder, remote_storage_kind: RemoteStorageKind
@@ -262,7 +249,7 @@ def test_tenant_upgrades_index_json_from_v0(
wait_until(
number_of_iterations=5,
interval=1,
func=lambda: expect_tenant_to_download_timeline(pageserver_http, tenant_id),
func=lambda: assert_no_in_progress_downloads_for_tenant(pageserver_http, tenant_id),
)
pg = env.postgres.create_start("main")
@@ -371,7 +358,7 @@ def test_tenant_redownloads_truncated_file_on_startup(
wait_until(
number_of_iterations=5,
interval=1,
func=lambda: expect_tenant_to_download_timeline(client, tenant_id),
func=lambda: assert_no_in_progress_downloads_for_tenant(client, tenant_id),
)
restored_timelines = client.timeline_list(tenant_id)