tests: implement concurrency and load tests for inventory and orders#15
Merged
codewithme-py merged 1 commit intomainfrom Mar 2, 2026
Merged
tests: implement concurrency and load tests for inventory and orders#15codewithme-py merged 1 commit intomainfrom
codewithme-py merged 1 commit intomainfrom
Conversation
Owner
codewithme-py
commented
Mar 2, 2026
- feat(tests): add pytest concurrency tests for inventory reservations and ARQ expiry worker using asyncio.gather
- feat(load): implement Locust scenarios (HighLoadUser, OversellTestUser, OrderLoadUser) to stress test reserve and order creation flows
- fix(arq): resolve race condition causing double inventory returns on simultaneous reservation expirations
- fix(db): increase SQLAlchemy QueuePool size (POOL_SIZE=200) to handle high concurrency locking (SELECT FOR UPDATE) under load
- fix(api): fix TypeError in @idempotent decorator when serializing SQLAlchemy models (Order) by using jsonable_encoder
- fix(api): add explicit eager loading for Order.items relationship to resolve FastAPI ResponseValidationError
- fix(nginx): configure limit_req_status to return 429 Too Many Requests instead of 503 during extreme load bursts
- chore: refactor Locust load test files into dedicated load_tests/ directory and update Makefile test targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.