@@ -471,6 +471,7 @@ func TestPool_checkOut(t *testing.T) {
471471
472472 dialErr := errors .New ("create new connection error" )
473473 p := newPool (poolConfig {
474+ Address : "testaddr" ,
474475 ConnectTimeout : defaultConnectionTimeout ,
475476 }, WithDialer (func (Dialer ) Dialer {
476477 return DialerFunc (func (context.Context , string , string ) (net.Conn , error ) {
@@ -481,7 +482,7 @@ func TestPool_checkOut(t *testing.T) {
481482 require .NoError (t , err )
482483
483484 _ , err = p .checkOut (context .Background ())
484- var want error = ConnectionError {Wrapped : dialErr , init : true }
485+ var want error = ConnectionError {Wrapped : dialErr , init : true , message : "failed to connect to testaddr:27017" }
485486 assert .Equalf (t , want , err , "should return error from calling checkOut()" )
486487 // If a connection initialization error occurs during checkOut, removing and closing the
487488 // failed connection both happen asynchronously with the checkOut. Wait for up to 2s for
@@ -1278,7 +1279,7 @@ func TestBackgroundRead(t *testing.T) {
12781279 defer cancel ()
12791280 _ , err = conn .readWireMessage (ctx )
12801281 regex := regexp .MustCompile (
1281- `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1282+ `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
12821283 )
12831284 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
12841285 assert .Nil (t , conn .awaitRemainingBytes , "conn.awaitRemainingBytes should be nil" )
@@ -1318,7 +1319,7 @@ func TestBackgroundRead(t *testing.T) {
13181319 defer cancel ()
13191320 _ , err = conn .readWireMessage (ctx )
13201321 regex := regexp .MustCompile (
1321- `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1322+ `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
13221323 )
13231324 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
13241325 err = p .checkIn (conn )
@@ -1365,7 +1366,7 @@ func TestBackgroundRead(t *testing.T) {
13651366 defer cancel ()
13661367 _ , err = conn .readWireMessage (ctx )
13671368 regex := regexp .MustCompile (
1368- `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1369+ `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
13691370 )
13701371 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
13711372 err = p .checkIn (conn )
@@ -1417,7 +1418,7 @@ func TestBackgroundRead(t *testing.T) {
14171418 defer cancel ()
14181419 _ , err = conn .readWireMessage (ctx )
14191420 regex := regexp .MustCompile (
1420- `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1421+ `^connection\(.*\[-\d+\]\) incomplete read of message header: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
14211422 )
14221423 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
14231424 err = p .checkIn (conn )
@@ -1471,7 +1472,7 @@ func TestBackgroundRead(t *testing.T) {
14711472 defer cancel ()
14721473 _ , err = conn .readWireMessage (ctx )
14731474 regex := regexp .MustCompile (
1474- `^connection\(.*\[-\d+\]\) incomplete read of full message: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1475+ `^connection\(.*\[-\d+\]\) incomplete read of full message: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
14751476 )
14761477 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
14771478 err = p .checkIn (conn )
@@ -1521,7 +1522,7 @@ func TestBackgroundRead(t *testing.T) {
15211522 defer cancel ()
15221523 _ , err = conn .readWireMessage (ctx )
15231524 regex := regexp .MustCompile (
1524- `^connection\(.*\[-\d+\]\) incomplete read of full message: context deadline exceeded: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
1525+ `^connection\(.*\[-\d+\]\) incomplete read of full message: context deadline exceeded: client timed out waiting for server response: read tcp 127.0.0.1:.*->127.0.0.1:.*: i\/o timeout$` ,
15251526 )
15261527 assert .True (t , regex .MatchString (err .Error ()), "error %q does not match pattern %q" , err , regex )
15271528 err = p .checkIn (conn )
0 commit comments