-
Notifications
You must be signed in to change notification settings - Fork 27
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
RateLimitingMiddleware tests failed #267
Comments
@sinisaos Interesting - so it just effects the tests? If it broke |
I think I'd rather fix the test somehow, as the problem is related to the changes to I sometimes use the |
@sinisaos Thanks for reporting this. I have a fix for now. |
@dantownsend I don't think all these changes to the Piccolo API and Admin were necessary because if the Starlette testclient reverts back to provide scope client (there is a PR for that), all the tests will pass again. Apologies if I wasn't clear enough in my previous comment, but the rate limit is only broken in tests, not in real use. With the changes I suggested in the comment, there was no need to change the code (except the dispatch method) in the Piccolo API and Piccolo Admin, regardless of whether Starlette revert client scope to testclient or leaves it to |
@sinisaos Yeah, I saw the PR in the Starlette repo reverting it. The problem though is even if it gets merged today, FastAPI lags behind the latest version of Starlette, so we'd have to wait a while before our tests pass again. I think the only solutions for an immediate fix are version pinning FastAPI to an older version (before Starlette changed how the |
Scope client is set to
None
in Starlette>=0.35.0 testclient. Due to this change, the test forRateLimitingMiddleware
failed in Piccolo API and Piccolo Admin. We can fix it by changing rate limiter middleware dispatch method like thisor based on this discussion you can change the testing method. I leave this decision to you.
The text was updated successfully, but these errors were encountered: