mirror of
https://github.com/neondatabase/neon.git
synced 2026-06-04 05:50:38 +00:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user