mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
Make test_gc_cutoff test more robust.
Previously, if the failpoint was not reached for some reason, the test would only fail because it would reach the 5 minute timeout we have on all python tests. That's very subtle. Make it fail explicitly, if the failpoint is not hit on each iteration of the loop. Extracted from a larger PR, see https://github.com/neondatabase/neon/pull/2785/files#r1022765794
This commit is contained in:
committed by
Heikki Linnakangas
parent
3f93c6c6f0
commit
d013a2b227
@@ -1,3 +1,4 @@
|
|||||||
|
import pytest
|
||||||
from fixtures.neon_fixtures import NeonEnvBuilder, PgBin
|
from fixtures.neon_fixtures import NeonEnvBuilder, PgBin
|
||||||
|
|
||||||
|
|
||||||
@@ -35,10 +36,9 @@ def test_gc_cutoff(neon_env_builder: NeonEnvBuilder, pg_bin: PgBin):
|
|||||||
|
|
||||||
pageserver_http.configure_failpoints(("after-timeline-gc-removed-layers", "exit"))
|
pageserver_http.configure_failpoints(("after-timeline-gc-removed-layers", "exit"))
|
||||||
|
|
||||||
for i in range(5):
|
for _ in range(5):
|
||||||
try:
|
with pytest.raises(Exception):
|
||||||
pg_bin.run_capture(["pgbench", "-N", "-c5", "-T100", "-Mprepared", connstr])
|
pg_bin.run_capture(["pgbench", "-N", "-c5", "-T100", "-Mprepared", connstr])
|
||||||
except Exception:
|
env.pageserver.stop()
|
||||||
env.pageserver.stop()
|
env.pageserver.start()
|
||||||
env.pageserver.start()
|
pageserver_http.configure_failpoints(("after-timeline-gc-removed-layers", "exit"))
|
||||||
pageserver_http.configure_failpoints(("after-timeline-gc-removed-layers", "exit"))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user