refactor(test): unify how we clear shared buffers (#8634)

so that we can easily plug in LFC clearing as well.

Private discussion reference:
<https://neondb.slack.com/archives/C033A2WE6BZ/p1722942856987979>
This commit is contained in:
Joonas Koivunen
2024-08-13 20:14:42 +03:00
committed by GitHub
parent 8f170c5105
commit ae6e27274c
8 changed files with 21 additions and 15 deletions

View File

@@ -182,14 +182,8 @@ class Workload:
def validate(self, pageserver_id: Optional[int] = None):
endpoint = self.endpoint(pageserver_id)
result = endpoint.safe_psql_many(
[
"select clear_buffer_cache()",
f"""
SELECT COUNT(*) FROM {self.table}
""",
]
)
endpoint.clear_shared_buffers()
result = endpoint.safe_psql(f"SELECT COUNT(*) FROM {self.table}")
log.info(f"validate({self.expect_rows}): {result}")
assert result == [[("",)], [(self.expect_rows,)]]
assert result == [(self.expect_rows,)]