Skip to content

Commit bc4e1f1

Browse files
committed
test(control): bracket the disconnected-session lease boundary
1 parent 6b85df6 commit bc4e1f1

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Releases before v0.27.0 predate the changelog.
1111

1212
### Fixed
1313

14+
- **Disconnected-runner lease test tracks the actual reaper boundary**:
15+
the integration test now brackets the 10-minute dead-session threshold,
16+
rather than the 45-minute runner-facing lock, with enough headroom to
17+
remain deterministic under CI load.
18+
1419
- **Scheduled golden refreshes no longer launch an impossible hosted bake**:
1520
the apt-index freshness workflow now opens one idempotent draft PR asking for
1621
a manual host-side rebuild. Webhook `workflow_dispatch` boolean inputs are

‎crates/preloop-runner-server/tests/registration.rs‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3694,11 +3694,10 @@ async fn runner_lease_expiration_disconnect_reaper() {
36943694
*inner.job_requests.keys().next().unwrap()
36953695
};
36963696

3697-
// Exercise the just-before-boundary case without sleeping. The session
3698-
// must be dead here: a *live* session with a stale lease is the hung-
3699-
// worker case (reaped at HUNG_WORKER_LEASE_SECONDS), not the disconnect
3700-
// boundary this test isolates. Age the session past liveness so only the
3701-
// lease clock decides.
3697+
// Exercise both sides of the disconnected-session lease boundary without
3698+
// sleeping. A *live* session with a stale lease is the hung-worker case
3699+
// (reaped at HUNG_WORKER_LEASE_SECONDS), not the disconnect boundary.
3700+
// Leave headroom for the reaper on loaded CI hosts.
37023701
let liveness = state.test_tx().await.runner_liveness_timeout;
37033702
state
37043703
.test_db_mutate(|tx| {
@@ -3708,7 +3707,7 @@ async fn runner_lease_expiration_disconnect_reaper() {
37083707
tx.set_lease_renewed(
37093708
request_id,
37103709
1,
3711-
now - (JOB_LEASE_SECONDS as i64 - 1) * 1_000_000,
3710+
now - (DEAD_SESSION_LEASE_SECONDS as i64 - 30) * 1_000_000,
37123711
now + JOB_LEASE_SECONDS as i64 * 1_000_000,
37133712
)
37143713
.unwrap();
@@ -3730,13 +3729,13 @@ async fn runner_lease_expiration_disconnect_reaper() {
37303729
);
37313730
}
37323731

3733-
// Move just beyond the same production lease boundary and reap.
3732+
// Move past the disconnected-session boundary and reap.
37343733
state
37353734
.test_db_mutate(|tx| {
37363735
tx.set_lease_renewed(
37373736
request_id,
37383737
1,
3739-
crate::store::now_us() - (JOB_LEASE_SECONDS as i64 + 1) * 1_000_000,
3738+
crate::store::now_us() - (DEAD_SESSION_LEASE_SECONDS as i64 + 30) * 1_000_000,
37403739
crate::store::now_us() - 1_000_000,
37413740
)
37423741
.unwrap();

0 commit comments

Comments
 (0)