Improve test

This commit is contained in:
Bojan Serafimov
2022-03-18 14:37:01 -04:00
parent 02aa7c023a
commit 098d7046f8
2 changed files with 28 additions and 13 deletions

View File

@@ -10,14 +10,20 @@ def test_get_page(zenith_simple_env: ZenithEnv, zenbenchmark: ZenithBenchmarker)
tenant_hex = env.initial_tenant.hex
timeline = pg.safe_psql("SHOW zenith.zenith_timeline")[0][0]
# Long-lived cursor, useful for flushing
psconn = env.pageserver.connect()
pscur = psconn.cursor()
with closing(pg.connect()) as conn:
with conn.cursor() as cur:
cur.execute('create table t (i integer);')
cur.execute('insert into t values (0);')
for i in range(100):
for i in range(1000):
cur.execute(f'update t set i = {i};')
pscur.execute(f"do_gc {env.initial_tenant.hex} {timeline} 0")
cur.execute("select * from t;")
res = cur.fetchall()
print("AAAA")