3 ms·
In order to get proper error response when deadlock occurs in testing (not just in Go), use isolation level serializable on every transaction / connection. This
by ugizashinje 6y ago
In order to get proper error response when deadlock occurs in testing (not just in Go), use isolation level serializable on every transaction / connection. This is simplest most effective way I have found so far, also you can get in detail why/where it happened. Watch out for different packages test executions since they run in parallel by default, use
go test -p 1