From 5c8387aff11c34b6c73577bac2c699395ec1f3ab Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 22 Nov 2022 14:52:11 +0200 Subject: [PATCH] Fix setting failpoints in test_remote_storage_backup_and_restore The checkpoints in the test were numbered 1 and 2, but the code only tried to set the failpoints for checkpoint 0. So they were never set. --- test_runner/regress/test_remote_storage.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test_runner/regress/test_remote_storage.py b/test_runner/regress/test_remote_storage.py index c8fe19d01e..14ccaacaca 100644 --- a/test_runner/regress/test_remote_storage.py +++ b/test_runner/regress/test_remote_storage.py @@ -81,6 +81,16 @@ def test_remote_storage_backup_and_restore( checkpoint_numbers = range(1, 3) + # On the first iteration, exercise retry code path by making the uploads + # fail for the first 3 times + action = "3*return->off" + pageserver_http.configure_failpoints( + [ + ("before-upload-layer", action), + ("before-upload-index", action), + ] + ) + for checkpoint_number in checkpoint_numbers: with pg.cursor() as cur: cur.execute( @@ -99,14 +109,6 @@ def test_remote_storage_backup_and_restore( log.info(f"waiting for checkpoint {checkpoint_number} upload") - # insert upload failpoints to exercise retry code path - action = "3*return->off" if checkpoint_number == 0 else "off" - pageserver_http.configure_failpoints( - [ - ("before-upload-layer", action), - ("before-upload-index", action), - ] - ) # wait until pageserver successfully uploaded a checkpoint to remote storage wait_for_upload(client, tenant_id, timeline_id, current_lsn) log.info(f"upload of checkpoint {checkpoint_number} is done")