[TT-16980] Fix pgx v5 breaking change when postgres.prefer_simple_protocol is set to true #969
+100
−11
probelabs / Visor: quality
succeeded
Apr 17, 2026 in 2m 31s
✅ Check Passed (Warnings Found)
quality check passed. Found 2 warnings, but fail_if condition was not met.
Details
📊 Summary
- Total Issues: 2
- Warning Issues: 2
🔍 Failure Condition Results
Passed Conditions
- global_fail_if: Condition passed
Issues by Category
Logic (1)
⚠️ pumps/sql_pgxv5_test.go:655 - Usingrequire.NoErrorinside a deferred function is unsafe. If this assertion fails, it will callt.FailNow(), preventing any other deferred functions from executing. This can lead to incomplete test cleanup.
Architecture (1)
⚠️ pumps/sql_pgxv5_test.go:650 - The deferred function for cleaning up the database table is registered afterpmp.Init()is called. Ifpmp.Init()fails after the table has been created but before the function returns successfully, thedeferwill not be registered and the test table will be left behind, potentially causing subsequent tests to fail.
Powered by Visor from Probelabs
💡 TIP: You can chat with Visor using /visor ask <your question>
Annotations
Check warning on line 655 in pumps/sql_pgxv5_test.go
probelabs / Visor: quality
logic Issue
Using `require.NoError` inside a deferred function is unsafe. If this assertion fails, it will call `t.FailNow()`, preventing any other deferred functions from executing. This can lead to incomplete test cleanup.
Raw output
Replace `require.NoError` with `assert.NoError` in deferred functions to ensure that all cleanup operations are attempted, even if one of them fails.
Check warning on line 650 in pumps/sql_pgxv5_test.go
probelabs / Visor: quality
architecture Issue
The deferred function for cleaning up the database table is registered after `pmp.Init()` is called. If `pmp.Init()` fails after the table has been created but before the function returns successfully, the `defer` will not be registered and the test table will be left behind, potentially causing subsequent tests to fail.
Raw output
To ensure cleanup always runs, register the `defer` statement before calling `pmp.Init()` and ensure the deferred function can safely handle a `nil` or partially initialized `pmp.db` object.
Loading