diff --git a/test_runner/regress/test_pg_regress.py b/test_runner/regress/test_pg_regress.py index 411888efb..cb32c9fcc 100644 --- a/test_runner/regress/test_pg_regress.py +++ b/test_runner/regress/test_pg_regress.py @@ -20,6 +20,9 @@ from fixtures.pg_version import PgVersion from fixtures.remote_storage import s3_storage from fixtures.utils import skip_in_debug_build +import time +import threading + if TYPE_CHECKING: from fixtures.neon_fixtures import PgBin from pytest import CaptureFixture @@ -156,6 +159,23 @@ def test_pg_regress( ) endpoint.safe_psql(f"CREATE DATABASE {DBNAME}") + def run_confplay(connstr): + log.info("Starting configuration changer") + sizes = [1, 0] + i = 0 + t = threading.currentThread() + while getattr(t, "run", True): + size = sizes[i % len(sizes)] + i += 1 + pg_bin.run(["psql", "-c", f"ALTER SYSTEM SET neon.file_cache_size_limit='{size}MB'" , connstr]) + pg_bin.run(["psql", "-c", f"SELECT pg_reload_conf()" , connstr]) + time.sleep(0.2) + log.info("Finishing configuration changer") + + connstr = endpoint.connstr() + thread = threading.Thread(target=run_confplay, args=(connstr,), daemon=True) + thread.start() + # Create some local directories for pg_regress to run in. runpath = test_output_dir / "regress" (runpath / "testtablespace").mkdir(parents=True) @@ -189,7 +209,8 @@ def test_pg_regress( with capsys.disabled(): pg_bin.run(pg_regress_command, env=env_vars, cwd=runpath) - post_checks(env, test_output_dir, DBNAME, endpoint) + thread.run = False + time.sleep(1) # Run the PostgreSQL "isolation" tests, in src/test/isolation.