carlos / platform Public

lease: TestBlockedRenewalDeadlinePrecedesTakeover runs at a 3s TTL so its termination margin outlasts CI scheduling (#268)

marginForTTL gives short test TTLs ttl/10; at 900ms the 90ms margin was
less than a loaded runner's scheduling delay and failed main CI at
abcc732d. A 3s TTL gives 300ms and checks the same property (loss is
signalled before expiry, and a peer cannot take a live lock). 10/10 runs
pass locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 1e783b1923c28cfa4ff191eaed277a25d2bdacc8 parent 00fdf54
1 file changed, +4 −1
  • internal/lease/checkpoint_test.go +4 −1

CI passed — run details

diff --git a/internal/lease/checkpoint_test.go b/internal/lease/checkpoint_test.go
index cca33dbe7..515d8c472 100644
--- a/internal/lease/checkpoint_test.go
+++ b/internal/lease/checkpoint_test.go
@@ -340,7 +340,10 @@ func TestBlockedRenewalDeadlinePrecedesTakeover(t *testing.T) {
}
return nil
}}
- ttl := 900 * time.Millisecond
+ // marginForTTL gives short test TTLs a margin of ttl/10. At 900ms that
+ // was 90ms, less than a loaded CI runner's scheduling delay (#268); 3s
+ // gives 300ms and checks the same property. Production's margin is 5s.
+ ttl := 3 * time.Second
h := localHeld(t, backend, ttl)
until, e := h.SafeUntil()
if e != nil {