Skip to content

tests: implement concurrency and load tests for inventory and orders#15

Merged
codewithme-py merged 1 commit intomainfrom
test/usual-test-cov
Mar 2, 2026
Merged

tests: implement concurrency and load tests for inventory and orders#15
codewithme-py merged 1 commit intomainfrom
test/usual-test-cov

Conversation

@codewithme-py
Copy link
Owner

  • 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

@codewithme-py codewithme-py merged commit 15f676a into main Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant