Skip to content

test: make lease-expiry integration test deterministic#121

Merged
nficano merged 1 commit into
mainfrom
fix/flaky-lease-expiry-test
Jun 12, 2026
Merged

test: make lease-expiry integration test deterministic#121
nficano merged 1 commit into
mainfrom
fix/flaky-lease-expiry-test

Conversation

@nficano

@nficano nficano commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

LeaseExpiryTests.ValidateOpAsync after expires_at raises LEASE_EXPIRED gave only a 50ms window between submit and lease expiry. On a loaded CI runner, submit-time validation saw the lease as already expired and rejected the submit with INVALID_REQUEST instead of job.accepted (observed on PR #92's test run).

  • Widen expires_at to 1s so submit-time validation can't lose the race.
  • Replace the fixed 150ms agent delay with a ValidateOpAsync poll loop, so the first post-expiry call raises LEASE_EXPIRED deterministically.

Verified locally: 5 consecutive runs of the lease-expiry tests plus the full 268 unit + 28 integration suite, all green.

🤖 Generated with Claude Code

The 50ms expiry window raced against submit-time validation on slow
CI runners (lease already expired at submit -> INVALID_REQUEST instead
of job.accepted). Widen the window to 1s and poll ValidateOpAsync until
expiry instead of racing a fixed 150ms delay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@nficano, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 30 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 48866a44-cee7-4d65-b801-1a58bcc8f45d

📥 Commits

Reviewing files that changed from the base of the PR and between b0f624b and 7af5602.

📒 Files selected for processing (1)
  • tests/Arcp.IntegrationTests/LeaseExpiryTests.fs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/flaky-lease-expiry-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nficano nficano merged commit 69abb20 into main Jun 12, 2026
4 checks passed
@nficano nficano deleted the fix/flaky-lease-expiry-test branch June 12, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant