Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTaskSchedulerBase.shutdown now only joins the worker thread and the future queue when called with wait=True. The corresponding test timing was adjusted to avoid asserting immediate cancellation when shutdown(wait=False, cancel_futures=False) is used. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/executor/test_api.py (1)
164-166: Replace fixed sleep with bounded synchronization on the future.Line 164 uses a hardcoded delay (
sleep(0.1)), which can make this test flaky under variable runner load. Prefer waiting directly onfuture_1with a timeout.Proposed patch
- sleep(0.1) + done, _ = wait([future_1], timeout=2) + self.assertIn( + future_1, done, "Future did not settle within timeout after shutdown()." + ) self.assertTrue(future_1.done()) self.assertTrue(future_1.cancelled())🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/unit/executor/test_api.py` around lines 164 - 166, Replace the hardcoded sleep by synchronizing on the Future directly: call concurrent.futures.wait([future_1], timeout=0.1) (or future_1.result(timeout=0.1) wrapped to catch CancelledError) instead of sleep(0.1), then keep the assertions self.assertTrue(future_1.done()) and self.assertTrue(future_1.cancelled()); add the necessary import for concurrent.futures.wait if not present and reference the test variable future_1 when making the wait call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/unit/executor/test_api.py`:
- Around line 164-166: Replace the hardcoded sleep by synchronizing on the
Future directly: call concurrent.futures.wait([future_1], timeout=0.1) (or
future_1.result(timeout=0.1) wrapped to catch CancelledError) instead of
sleep(0.1), then keep the assertions self.assertTrue(future_1.done()) and
self.assertTrue(future_1.cancelled()); add the necessary import for
concurrent.futures.wait if not present and reference the test variable future_1
when making the wait call.
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Summary by CodeRabbit
Bug Fixes
Tests