From 72131e15ffe9def835e72f13e332f6470335ddf2 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 10 May 2023 17:08:11 +0300 Subject: [PATCH] test: less racy test_delete_timeline_client_hangup with the SharedRetried the first request creates a task which will continue to the pause point regardless of the first request, so we need to accept a 404 as success. --- test_runner/regress/test_timeline_delete.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test_runner/regress/test_timeline_delete.py b/test_runner/regress/test_timeline_delete.py index 9ad0c90e4e..9b92b077e0 100644 --- a/test_runner/regress/test_timeline_delete.py +++ b/test_runner/regress/test_timeline_delete.py @@ -462,9 +462,16 @@ def test_delete_timeline_client_hangup(neon_env_builder: NeonEnvBuilder): # ok, retry without failpoint, it should succeed ps_http.configure_failpoints((failpoint_name, "off")) - # this should succeed - ps_http.timeline_delete(env.initial_tenant, child_timeline_id, timeout=2) - # the second call will try to transition the timeline into Stopping state, but it's already in that state - env.pageserver.allowed_errors.append( - f".*{child_timeline_id}.*Ignoring new state, equal to the existing one: Stopping" - ) + try: + ps_http.timeline_delete(env.initial_tenant, child_timeline_id) + env.pageserver.allowed_errors.append( + f".*{child_timeline_id}.*Ignoring new state, equal to the existing one: Stopping" + ) + except PageserverApiException as e: + if e.status_code != 404: + raise e + else: + # mock_s3 was fast enough to delete before we got the request in + env.pageserver.allowed_errors.append( + f".*{child_timeline_id}.*Error processing HTTP request: NotFound: timeline not found" + )