fix(pgtest): use t.Fatalf instead of t.Errorf for missing CL_DATABASE_URL#21956
fix(pgtest): use t.Fatalf instead of t.Errorf for missing CL_DATABASE_URL#21956
Conversation
…_URL pgtest.NewSqlxDB used t.Errorf (non-fatal) when CL_DATABASE_URL was missing, then returned nil. This caused SIGSEGV panics in downstream tests when they called methods on the nil *sqlx.DB. Changing to t.Fatalf stops test execution immediately, preventing the nil DB from propagating. Fixes: CORE-2371
|
👋 Fletch153, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
|
|
/rerun |
|
There was a problem hiding this comment.
There's another copy of this in the integration tests module.





Summary
t.Errorf→t.Fatalfinpgtest.NewSqlxDBwhenCL_DATABASE_URLis missing*sqlx.DBpropagating to downstream testsRoot Cause
t.Errorfis non-fatal, so the function returnednil. Any test callingpgtest.NewSqlxDBwithout a database URL would get a nil DB and panic on the first query.Test plan
pgtest.NewSqlxDBwithout DB fail cleanly instead of panickingFixes: CORE-2371