Fix test for new named ErrAcquireTimeout
This commit is contained in:
+2
-2
@@ -276,8 +276,8 @@ func TestPoolWithAcquireTimeoutSet(t *testing.T) {
|
|||||||
// ... then try to consume 1 more. It should fail after a short timeout.
|
// ... then try to consume 1 more. It should fail after a short timeout.
|
||||||
_, timeTaken, err := acquireWithTimeTaken(pool)
|
_, timeTaken, err := acquireWithTimeTaken(pool)
|
||||||
|
|
||||||
if err == nil || err.Error() != "Timeout: All connections in pool are busy" {
|
if err == nil || err != pgx.ErrAcquireTimeout {
|
||||||
t.Fatalf("Expected error to be 'Timeout: All connections in pool are busy', instead it was '%v'", err)
|
t.Fatalf("Expected error to be pgx.ErrAcquireTimeout, instead it was '%v'", err)
|
||||||
}
|
}
|
||||||
if timeTaken < connAllocTimeout {
|
if timeTaken < connAllocTimeout {
|
||||||
t.Fatalf("Expected connection allocation time to be at least %v, instead it was '%v'", connAllocTimeout, timeTaken)
|
t.Fatalf("Expected connection allocation time to be at least %v, instead it was '%v'", connAllocTimeout, timeTaken)
|
||||||
|
|||||||
Reference in New Issue
Block a user