File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ async fn lsn_lease_bg_task(
62
62
"Request succeeded, sleeping for {} seconds" ,
63
63
sleep_duration. as_secs( )
64
64
) ;
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 ?;
66
70
}
67
71
}
68
72
Original file line number Diff line number Diff line change @@ -233,15 +233,6 @@ def trigger_gc_and_select(
233
233
log .info (f"`SELECT` query succeed after GC, { ctx = } " )
234
234
return offset
235
235
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
-
245
236
# Insert some records on main branch
246
237
with env .endpoints .create_start ("main" , config_lines = ["shared_buffers=1MB" ]) as ep_main :
247
238
with ep_main .cursor () as cur :
@@ -254,9 +245,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
254
245
XLOG_BLCKSZ = 8192
255
246
lsn = Lsn ((int (lsn ) // XLOG_BLCKSZ ) * XLOG_BLCKSZ )
256
247
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
-
260
248
with env .endpoints .create_start (
261
249
branch_name = "main" ,
262
250
endpoint_id = "static" ,
@@ -277,8 +265,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
277
265
ps .stop ()
278
266
ps .start ()
279
267
280
- renew_lease (env , lsn )
281
-
282
268
trigger_gc_and_select (
283
269
env ,
284
270
ep_static ,
You can’t perform that action at this time.
0 commit comments