From 73fe203d62a6ea648a1d824af6987f3bb2d75116 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 17:46:07 +0200 Subject: [PATCH] test: fourth review -- a hang-up anywhere in the body, an abandoned request is not an implicit 200, a database error is logged as its SQLSTATE (red) Co-Authored-By: Claude Sonnet 5.5 --- internal/uploads/worker_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/uploads/worker_test.go b/internal/uploads/worker_test.go index 253501c..04b9abe 100644 --- a/internal/uploads/worker_test.go +++ b/internal/uploads/worker_test.go @@ -324,3 +324,11 @@ func TestWorkerRun_StoppingDeletesQueuedAudioAndRefusesNewJobs(t *testing.T) { assert.Empty(t, r.leftovers(t), "audio of queued jobs is deleted on stop: the rows are swept to interrupted at next start") assert.ErrorIs(t, r.w.Submit(r.spool(t, "c")), uploads.ErrStopped) } + +// dbErr is an error shaped like pgx's: a message that quotes a value, and an SQLSTATE. +type dbErr struct{} + +func (dbErr) Error() string { + return `ERROR: invalid input syntax for type json: "zebrakaka secret words"` +} +func (dbErr) SQLState() string { return "22P02" }