Skip to content

test(fuzz): make client fixture module-scoped to prevent startup failures#1051

Open
callebtc wants to merge 1 commit into
cashubtc:mainfrom
callebtc:fix/fuzz-test-client-lifecycle
Open

test(fuzz): make client fixture module-scoped to prevent startup failures#1051
callebtc wants to merge 1 commit into
cashubtc:mainfrom
callebtc:fix/fuzz-test-client-lifecycle

Conversation

@callebtc

Copy link
Copy Markdown
Collaborator

Fixes fuzz test failures where alternating tests failed during TestClient(app) setup with SystemExit(1) / CancelledError.

The function-scoped client fixture was starting and shutting down the global FastAPI app for every fuzz test. After the first teardown, the next startup failed (likely due to the management RPC server lifecycle / global state not being fully reset). Making the fixture module-scoped starts the app once for the entire fuzz module and avoids the lifecycle conflict.

Verified with make test:

720 passed, 67 skipped, 33 warnings in 419.90s

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.29%. Comparing base (066a771) to head (2c97388).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
- Coverage   74.32%   74.29%   -0.03%     
==========================================
  Files         111      111              
  Lines       12372    12372              
==========================================
- Hits         9195     9192       -3     
- Misses       3177     3180       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant