From 1022b4b98fa859eaed9d8a0d3b6a99c7c7c9499a Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Thu, 24 Nov 2022 07:34:03 -0500 Subject: [PATCH] use utils::failpoint_sleep_millis_async!("attach-before-activate") The detach_while_attaching test still passes, presumably because the two request execute on different OS threads. --- pageserver/src/tenant.rs | 4 +--- test_runner/regress/test_tenant_detach.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 14cdd1e334..0447a3b9de 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -640,9 +640,7 @@ impl Tenant { crashsafe::fsync(marker_file.parent().expect("marker file has parent dir")) .context("fsync tenant directory after unlinking attach marker file")?; - fail::fail_point!("attach-before-activate", |_| { - anyhow::bail!("failpoint attach-beore-activate"); - }); + utils::failpoint_sleep_millis_async!("attach-before-activate"); // Start background operations and open the tenant for business. // The loops will shut themselves down when they notice that the tenant is inactive. diff --git a/test_runner/regress/test_tenant_detach.py b/test_runner/regress/test_tenant_detach.py index 2afef2835c..9a0f7f7313 100644 --- a/test_runner/regress/test_tenant_detach.py +++ b/test_runner/regress/test_tenant_detach.py @@ -153,7 +153,7 @@ def test_detach_while_attaching( pageserver_http.tenant_detach(tenant_id) # And re-attach - pageserver_http.configure_failpoints([("attach-before-activate", "sleep(5000)")]) + pageserver_http.configure_failpoints([("attach-before-activate", "return(5000)")]) pageserver_http.tenant_attach(tenant_id)