refactor: PageserverHttpClient method for breaking tenant from tests

This commit is contained in:
Christian Schwarz
2023-03-20 17:17:25 +01:00
parent 4aa528ce45
commit 68b3e68642
2 changed files with 5 additions and 4 deletions

View File

@@ -1546,6 +1546,10 @@ class PageserverHttpClient(requests.Session):
self.verbose_error(res)
return res.json()
def tenant_break(self, tenant_id: TenantId):
res = self.put(f"http://localhost:{self.port}/v1/tenant/{tenant_id}/break")
self.verbose_error(res)
@dataclass
class TenantConfig:

View File

@@ -101,10 +101,7 @@ def eviction_env(request, neon_env_builder: NeonEnvBuilder, pg_bin: PgBin) -> It
# break the difficult to use initial default tenant, later assert that it has not been evicted
broken_tenant_id, broken_timeline_id = (env.initial_tenant, env.initial_timeline)
assert broken_timeline_id is not None
res = pageserver_http.put(
f"http://localhost:{pageserver_http.port}/v1/tenant/{env.initial_tenant}/break"
)
pageserver_http.verbose_error(res)
pageserver_http.tenant_break(env.initial_tenant)
(broken_on_disk_before, _, _) = poor_mans_du(
env, timelines=[(broken_tenant_id, broken_timeline_id)]
)