You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix test DB connection: use DATABASE_URL with dotenv
## Summary
- **Absorbed PR #2434** (DB connect_timeout): adds `connect_timeout=5` to all DB connections so tests fail fast instead of hanging when Postgres is unavailable. Reverts timeout from production code (a 5s timeout could break real deployments), keeping it only in test code.
- Adds `require_dynamodb()` and `require_s3()` helpers to conftest that probe services with short timeouts and `pytest.fail()` immediately — applied to all tests that previously hung when Docker services were down.
- Adds `pytest-timestamper` for per-test timing visibility.
- Fixes `test_postgres_real_data.py` to use `DATABASE_URL` (consistent with all other delphi Python code) via `python-dotenv`.
Refs #2442
## Test plan
- [x] `test_conversation_from_postgres` passes
- [x] `test_pakistan_conversation_batch` passes (9 min, 400K votes)
- [x] Full delphi test suite: 294 passed, no regressions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Squashed commits
- Add connect_timeout to all DB connections, fail tests on DB unavailable
- Fail tests fast when services are unavailable instead of hanging
- Fix conftest docstring: require_dynamodb/require_s3, not require_service
- Skip (not fail) test_minio_access when MinIO is unavailable
- Fail test_conversation_from_postgres fast when DynamoDB is unavailable
- Fail test_run_math_pipeline_e2e fast when DynamoDB is unavailable
- Add pytest-timestamper and fix test_501 hang on Docker unavailable
- Defer heavy import in test_umap_narrative_pipeline (defensive)
- Address Copilot review: fix timing_stats_compared None bug, fix return type
- Fix test DB connection: use DATABASE_URL with dotenv
- Fix CI: use find_dotenv() and fall back to DATABASE_* vars
- Restore get_or_compute_conversation fixture and test reordering hook
- Remove dead xdist_group markers from make_dataset_params
commit-id:b9062b50
0 commit comments