test: fix: accidentally re-enabled compaction & gc

This commit is contained in:
Christian Schwarz
2023-03-30 14:06:15 +02:00
parent cbaba7c089
commit d5b8f123ec
2 changed files with 20 additions and 2 deletions

View File

@@ -1228,6 +1228,20 @@ class PageserverHttpClient(requests.Session):
)
self.verbose_error(res)
def patch_tenant_config_client_side(
self,
tenant_id: TenantId,
inserts: Optional[Dict[str, Any]] = None,
removes: Optional[List[str]] = None,
):
current = self.tenant_config(tenant_id).tenant_specific_overrides
if inserts is not None:
current.update(inserts)
if removes is not None:
for key in removes:
del current[key]
self.set_tenant_config(tenant_id, current)
def tenant_size(self, tenant_id: TenantId) -> int:
return self.tenant_size_and_modelinputs(tenant_id)[0]

View File

@@ -295,8 +295,12 @@ def test_pageserver_respects_overridden_resident_size(eviction_env: EvictionEnv)
[du > min_resident_size for du in du_by_timeline.values()]
), "ensure the larger tenant will get a haircut"
ps_http.set_tenant_config(small_tenant[0], {"min_resident_size_override": min_resident_size})
ps_http.set_tenant_config(large_tenant[0], {"min_resident_size_override": min_resident_size})
ps_http.patch_tenant_config_client_side(
small_tenant[0], {"min_resident_size_override": min_resident_size}
)
ps_http.patch_tenant_config_client_side(
large_tenant[0], {"min_resident_size_override": min_resident_size}
)
# Make the large tenant more-recently used. An incorrect implemention would try to evict
# from the smaller tenant first, since its layers would be the least-recently-used.