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:
@@ -197,3 +197,19 @@ func TestWorkerProgress_AFailureLogsAKindNeverTheErrorTextOrThePath(t *testing.T
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestWorkerProgress_AStoreFailureLogsItsSQLStateNeverTheValueItQuotes(t *testing.T) {
|
||||||
|
// A Postgres error can quote the offending value; for a transcript row that is the
|
||||||
|
// transcript (fourth adversarial review). The log gets the SQLSTATE.
|
||||||
|
r := newWRig(t, time.Minute)
|
||||||
|
r.st.completeErr = dbErr{}
|
||||||
|
buf := &syncLog{}
|
||||||
|
w := newProgressWorker(t, r, r.tr, uploads.WithLogger(slog.New(slog.NewTextHandler(buf, nil))))
|
||||||
|
|
||||||
|
w.Process(context.Background(), r.spool(t, "a"))
|
||||||
|
|
||||||
|
out := buf.String()
|
||||||
|
assert.NotContains(t, out, "zebrakaka")
|
||||||
|
assert.Contains(t, out, "upload: store transcript")
|
||||||
|
assert.Contains(t, out, "kind=sql_22P02")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user