mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 06:00:38 +00:00
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
from contextlib import closing
|
|
from fixtures.zenith_fixtures import ZenithEnv
|
|
from fixtures.benchmark_fixture import MetricReport, ZenithBenchmarker
|
|
|
|
|
|
def test_get_page(zenith_simple_env: ZenithEnv, zenbenchmark: ZenithBenchmarker):
|
|
env = zenith_simple_env
|
|
env.zenith_cli.create_branch("test_pageserver", "empty")
|
|
pg = env.postgres.create_start('test_pageserver')
|
|
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(100000):
|
|
cur.execute(f'update t set i = {i};')
|
|
|
|
pscur.execute(f"checkpoint {env.initial_tenant.hex} {timeline} 0")
|
|
|
|
cur.execute("select * from t;")
|
|
res = cur.fetchall()
|
|
print("AAAA")
|
|
print(res)
|
|
|
|
env.run_psbench(timeline)
|