Commit a962f2c
fix(core): shield remaining asyncpg dispose seams + observe nest_asyncio skip
Address claude-review feedback and the Windows SQLite Unit CI failure on PR #902.
- db.py engine_session_factory finally: shield created_engine.dispose() with
suppress(CancelledError) to match the other dispose seams (review item 2).
- db.py run_migrations finally: shield temp_engine.dispose() the same way; it is
on the same asyncpg startup path as the crash (review item 1).
- alembic/env.py: log the nest_asyncio ImportError/ValueError at DEBUG instead of
silently passing, so the now-expected uvloop ValueError on every Postgres
startup is observable without being noisy (review item 3).
- tests/cli/test_cli_exit.py: loosen test_bm_version_exits_cleanly subprocess
timeout 10s -> 20s to match its sibling --help test. The new uvloop code never
runs on the 'bm --version' path (eager version_callback exits before
app_callback's body, and db.py is not even imported), so the Windows-only
failure is uv-run startup contention under full-suite load, not a regression.
Verified: ruff, ty, the affected unit tests, and the Postgres dispose-cycle
integration test (testcontainers) all pass locally.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>1 parent fe0001a commit a962f2c
3 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
| |||
479 | 486 | | |
480 | 487 | | |
481 | 488 | | |
482 | | - | |
483 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
484 | 494 | | |
485 | | - | |
| 495 | + | |
| 496 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments