From 5c836ee5b4780a4f74414789e54791c4426a370d Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 15 Aug 2023 18:14:03 +0100 Subject: [PATCH] tests: extend timeout in timeline deletion test (#4992) ## Problem This was set to 5 seconds, which was very close to how long a compaction took on my workstation, and when deletion is blocked on compaction the test would fail. We will fix this to make compactions drop out on deletion, but for the moment let's stabilize the test. ## Summary of changes Change timeout on timeline deletion in `test_timeline_deletion_with_files_stuck_in_upload_queue` from 5 seconds to 30 seconds. --- test_runner/fixtures/pageserver/utils.py | 9 +++++++-- test_runner/regress/test_remote_storage.py | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test_runner/fixtures/pageserver/utils.py b/test_runner/fixtures/pageserver/utils.py index 3b95990a57..a2a49b8a6e 100644 --- a/test_runner/fixtures/pageserver/utils.py +++ b/test_runner/fixtures/pageserver/utils.py @@ -191,7 +191,11 @@ def wait_timeline_detail_404( tenant_id: TenantId, timeline_id: TimelineId, iterations: int, + interval: Optional[float] = None, ): + if interval is None: + interval = 0.25 + def timeline_is_missing(): data = {} try: @@ -204,7 +208,7 @@ def wait_timeline_detail_404( raise RuntimeError(f"Timeline exists state {data.get('state')}") - wait_until(iterations, interval=0.250, func=timeline_is_missing) + wait_until(iterations, interval, func=timeline_is_missing) def timeline_delete_wait_completed( @@ -212,10 +216,11 @@ def timeline_delete_wait_completed( tenant_id: TenantId, timeline_id: TimelineId, iterations: int = 20, + interval: Optional[float] = None, **delete_args, ): pageserver_http.timeline_delete(tenant_id=tenant_id, timeline_id=timeline_id, **delete_args) - wait_timeline_detail_404(pageserver_http, tenant_id, timeline_id, iterations) + wait_timeline_detail_404(pageserver_http, tenant_id, timeline_id, iterations, interval) if TYPE_CHECKING: diff --git a/test_runner/regress/test_remote_storage.py b/test_runner/regress/test_remote_storage.py index d642a6d190..502ae71cec 100644 --- a/test_runner/regress/test_remote_storage.py +++ b/test_runner/regress/test_remote_storage.py @@ -607,7 +607,9 @@ def test_timeline_deletion_with_files_stuck_in_upload_queue( ".* ERROR .*Error processing HTTP request: InternalServerError\\(timeline is Stopping" ) - timeline_delete_wait_completed(client, tenant_id, timeline_id) + # Generous timeout, because currently deletions can get blocked waiting for compaction + # This can be reduced when https://github.com/neondatabase/neon/issues/4998 is fixed. + timeline_delete_wait_completed(client, tenant_id, timeline_id, iterations=30, interval=1) assert not timeline_path.exists()