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 <noreply@anthropic.com>
This commit is contained in:
@@ -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.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)
|
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" }
|
||||||
|
|||||||
Reference in New Issue
Block a user