Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/Arcp.IntegrationTests/LeaseExpiryTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ let ``ValidateOpAsync after expires_at raises LEASE_EXPIRED`` () =
"indexer",
fun ctx ->
task {
do! Task.Delay(150)
do! ctx.ValidateOpAsync(Capabilities.FsRead, "/data/file", ctx.CancellationToken)
// Poll until expires_at passes; the first post-expiry
// call raises LEASE_EXPIRED and fails the job. Avoids
// racing a fixed delay against the expiry window.
while true do
do! ctx.ValidateOpAsync(Capabilities.FsRead, "/data/file", ctx.CancellationToken)
do! Task.Delay(25)

return Json.serializeToElement<int> 0
}
))
Expand All @@ -67,7 +72,9 @@ let ``ValidateOpAsync after expires_at raises LEASE_EXPIRED`` () =
LeaseConstraints =
Some
{
ExpiresAt = DateTimeOffset.UtcNow.AddMilliseconds(50.0)
// Far enough out that submit-time validation can't see an
// already-expired lease on a slow CI runner.
ExpiresAt = DateTimeOffset.UtcNow.AddSeconds(1.0)
}
}

Expand Down