From 4dd805b68a9f8b8feb06bb567c9629bb344d3d1b Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 24 Jul 2024 12:53:21 +0000 Subject: [PATCH] test: remove the extra deletion which was confusing it had already been reparented, so it was not needed. --- .../regress/test_timeline_detach_ancestor.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test_runner/regress/test_timeline_detach_ancestor.py b/test_runner/regress/test_timeline_detach_ancestor.py index fffc9d516b..fa8c5be331 100644 --- a/test_runner/regress/test_timeline_detach_ancestor.py +++ b/test_runner/regress/test_timeline_detach_ancestor.py @@ -1,6 +1,5 @@ import datetime import enum -import itertools import threading import time from concurrent.futures import ThreadPoolExecutor @@ -1110,6 +1109,7 @@ def test_retried_detach_ancestor_after_failed_reparenting(neon_env_builder: Neon # detach "E" which has most reparentable timelines under it detached = timelines.pop() + assert len(timelines) == 4 http = http.without_status_retrying() @@ -1125,8 +1125,7 @@ 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(len(timelines) - 1): - log.info(f"{nth_round} round") + for nth_round in range(3): with pytest.raises( PageserverApiException, match=".*failed to reparent all candidate timelines, please retry", @@ -1184,16 +1183,15 @@ def test_retried_detach_ancestor_after_failed_reparenting(neon_env_builder: Neon ".* attach\\{.* gen=00000001\\}: attach finished, activating", offset ) - # delete the remaining and previous ancestor to take a different path to - # completion (all other tests take the "detach? reparent complete", but - # this is only "complete". - for timeline in itertools.chain(not_reparented, [env.initial_timeline]): - http.timeline_delete(env.initial_tenant, timeline) - wait_timeline_detail_404(http, env.initial_tenant, timeline, 20) + # delete the previous ancestor to take a different path to completion. all + # other tests take the "detach? reparent complete", but this only hits + # "complete". + http.timeline_delete(env.initial_tenant, env.initial_timeline) + wait_timeline_detail_404(http, env.initial_tenant, env.initial_timeline, 20) http.configure_failpoints(("timeline-detach-ancestor::complete_before_uploading", "off")) + reparented_resp = http.detach_ancestor(env.initial_tenant, detached) - timelines = [x for x in timelines if x not in not_reparented] assert reparented_resp == timelines # no need to quiesce_tenants anymore, because completion does that @@ -1209,7 +1207,7 @@ def test_retried_detach_ancestor_after_failed_reparenting(neon_env_builder: Neon ), "there should be no restart with the final detach_ancestor as it only completed" # gc is unblocked - env.pageserver.assert_log_contains(".* gc_loop.*: 4 timelines need GC", offset) + env.pageserver.assert_log_contains(".* gc_loop.*: 5 timelines need GC", offset) metric = remote_storage_copy_requests() assert remote_copies == metric