From f58636ffddb40af4d6eeb095d9f686f14b748c19 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Fri, 26 Jul 2024 08:57:33 +0000 Subject: [PATCH] test: refactor -- begin to -funroll-loops in test_retried_detach_ancestor_after_failed_reparenting --- .../regress/test_timeline_detach_ancestor.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test_runner/regress/test_timeline_detach_ancestor.py b/test_runner/regress/test_timeline_detach_ancestor.py index 4fb5c77cd3..b2690431f9 100644 --- a/test_runner/regress/test_timeline_detach_ancestor.py +++ b/test_runner/regress/test_timeline_detach_ancestor.py @@ -1163,14 +1163,17 @@ def test_retried_detach_ancestor_after_failed_reparenting(neon_env_builder: Neon # tracked offset in the pageserver log which is at least at the most recent activation offset = None - for nth_round in range(3): + def another_detach(): with pytest.raises( - PageserverApiException, - match=".*failed to reparent all candidate timelines, please retry", - ) as exc: - http.detach_ancestor(env.initial_tenant, detached) + PageserverApiException, + match=".*failed to reparent all candidate timelines, please retry", + ) as exc: + http.detach_ancestor(env.initial_tenant, detached) assert exc.value.status_code == 500 + for nth_round in range(3): + another_detach() + assert ( http.timeline_detail(env.initial_tenant, detached)["ancestor_timeline_id"] is None ), "first round should had detached 'detached'"