-
-
Notifications
You must be signed in to change notification settings - Fork 313
Fix CI/CD throttling issue: Fix test exemption in throttling middleware #4766
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
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: DonnieBLT <[email protected]>
|
@copilot I mean the tests that we run against our own pages trigger the throttle - we had added throttling being exempt for tests but maybe there is something that got reverted with that - please focus on fixing that |
Fixed in commit 8ff7557. The throttling middleware was checking |
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.
@copilot undo the changes to this file
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.
Reverted in commit 57b7074. The ci-cd.yml file has been restored to its original state with the poetry lock commands back in place.
Co-authored-by: DonnieBLT <[email protected]>
The throttling middleware was not properly detecting test mode when tests ran through
xvfb-runandpoetry runin CI, causing rate limiting to trigger on the application's own pages during test execution.Changes Made
Throttling Middleware (
blt/middleware/throttling.py):IS_TESTandTESTING) instead of checkingsys.argvsysimportRoot Cause
The middleware was checking
if "test" in sys.argvwhich is unreliable when tests run throughxvfb-runandpoetry run. Django's settings already haveIS_TESTandTESTINGflags that are properly set during test execution.This ensures throttling is properly disabled during test runs, preventing rate limiting from affecting CI/CD test execution.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.