fix test_timeline_create_break_after_uninit_mark (the refactoring added .context())

This commit is contained in:
Christian Schwarz
2023-05-26 10:19:24 +02:00
parent 609a929968
commit 60cc197ce3
2 changed files with 4 additions and 1 deletions

View File

@@ -2817,6 +2817,7 @@ impl Tenant {
crashsafe::create_dir_all(timeline_path).context("Failed to create timeline directory")?;
fail::fail_point!("after-timeline-uninit-mark-creation", |_| {
error!("hitting failpoint after-timeline-uninit-mark-creation");
anyhow::bail!("failpoint after-timeline-uninit-mark-creation");
});

View File

@@ -172,8 +172,10 @@ def test_timeline_create_break_after_uninit_mark(neon_simple_env: NeonEnv):
# Introduce failpoint when creating a new timeline uninit mark, before any other files were created
pageserver_http.configure_failpoints(("after-timeline-uninit-mark-creation", "return"))
with pytest.raises(Exception, match="after-timeline-uninit-mark-creation"):
with pytest.raises(Exception, match="create timeline files"):
_ = env.neon_cli.create_timeline("test_timeline_create_break_after_uninit_mark", tenant_id)
env.pageserver.allowed_errors.append(".*InternalServerError.*create timeline files")
env.pageserver.allowed_errors.append(".*hitting failpoint after-timeline-uninit-mark-creation")
# Creating the timeline didn't finish. The other timelines on tenant should still be present and work normally.
# "New" timeline is not present in the list, allowing pageserver to retry the same request