-
Notifications
You must be signed in to change notification settings - Fork 9
fix race condition in beginlease test #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe change staggered BeginTime assignments for two leases in the test suite by introducing distinct future timestamps—1 second for lease1 and 1.1 seconds for lease2—to ensure deterministic ordering and prevent timing races when leases are concurrently created and verified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (1)
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. Comment |
|
|
||
| // Use same BeginTime for both to avoid timing races | ||
| sharedBeginTime := metav1.NewTime(time.Now().Truncate(time.Second).Add(1 * time.Second)) | ||
| // Give lease1 an earlier BeginTime to ensure deterministic ordering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the controller is non deterministic when two leases share begin time.
Summary by CodeRabbit