This commit is contained in:
Konstantin Knizhnik
2024-03-28 20:58:52 +02:00
parent 40226ce7da
commit 48013845f0

View File

@@ -13,7 +13,9 @@ from fixtures.neon_fixtures import NeonEnv, PgBin
def test_pageserver_restarts_under_worload(neon_simple_env: NeonEnv, pg_bin: PgBin):
env = neon_simple_env
env.neon_cli.create_branch("test_pageserver_restarts")
endpoint = env.endpoints.create_start("test_pageserver_restarts", config_lines=["effective_io_concurrency=100"])
endpoint = env.endpoints.create_start(
"test_pageserver_restarts", config_lines=["effective_io_concurrency=100"]
)
n_restarts = 100
scale = 10
@@ -21,7 +23,7 @@ def test_pageserver_restarts_under_worload(neon_simple_env: NeonEnv, pg_bin: PgB
def run_pgbench(connstr: str):
log.info(f"Start a pgbench workload on pg {connstr}")
pg_bin.run_capture(["pgbench", "-i", f"-s{scale}", connstr])
pg_bin.run_capture(["pgbench", f"-c 10 -f select.sql -T{n_restarts}", connstr])
pg_bin.run_capture(["pgbench", "-c", "10", "-f", "select.sql", f"-T{n_restarts}", connstr])
thread = threading.Thread(target=run_pgbench, args=(endpoint.connstr(),), daemon=True)
thread.start()