Skip to content

Commit 5622bf0

Browse files
committed
maybe the old test would work?
Signed-off-by: Alex Chi Z <chi@neon.tech>
1 parent 81d0f5d commit 5622bf0

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

compute_tools/src/lsn_lease.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ async fn lsn_lease_bg_task(
6262
"Request succeeded, sleeping for {} seconds",
6363
sleep_duration.as_secs()
6464
);
65-
compute.wait_timeout_while_pageserver_connstr_unchanged(sleep_duration);
65+
let compute = compute.clone();
66+
tokio::task::spawn_blocking(move || {
67+
compute.wait_timeout_while_pageserver_connstr_unchanged(sleep_duration);
68+
})
69+
.await?;
6670
}
6771
}
6872

test_runner/regress/test_readonly_node.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,6 @@ def trigger_gc_and_select(
233233
log.info(f"`SELECT` query succeed after GC, {ctx=}")
234234
return offset
235235

236-
# It's not reliable to let the compute renew the lease in this test case as we have a very tight
237-
# lease timeout. Therefore, the test case itself will renew the lease.
238-
#
239-
# This is a workaround to make the test case more deterministic.
240-
def renew_lease(env: NeonEnv, lease_lsn: Lsn):
241-
env.storage_controller.pageserver_api().timeline_lsn_lease(
242-
env.initial_tenant, env.initial_timeline, lease_lsn
243-
)
244-
245236
# Insert some records on main branch
246237
with env.endpoints.create_start("main", config_lines=["shared_buffers=1MB"]) as ep_main:
247238
with ep_main.cursor() as cur:
@@ -254,9 +245,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
254245
XLOG_BLCKSZ = 8192
255246
lsn = Lsn((int(lsn) // XLOG_BLCKSZ) * XLOG_BLCKSZ)
256247

257-
# We need to mock the way cplane works: it gets a lease for a branch before starting the compute.
258-
renew_lease(env, lsn)
259-
260248
with env.endpoints.create_start(
261249
branch_name="main",
262250
endpoint_id="static",
@@ -277,8 +265,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
277265
ps.stop()
278266
ps.start()
279267

280-
renew_lease(env, lsn)
281-
282268
trigger_gc_and_select(
283269
env,
284270
ep_static,

0 commit comments

Comments
 (0)