@@ -2731,7 +2731,7 @@ func TestClientRequestObjectsWithPassedCanceledContext(t *testing.T) {
27312731 req := NewPingRequest ().Context (ctx )
27322732 cancel ()
27332733 resp , err := conn .Do (req ).Get ()
2734- if err .Error () != "context is done" {
2734+ if ! strings . HasPrefix ( err .Error (), "context is done" ) {
27352735 t .Fatalf ("Failed to catch an error from done context" )
27362736 }
27372737 if resp != nil {
@@ -2802,7 +2802,7 @@ func TestClientRequestObjectsWithContext(t *testing.T) {
28022802 if err == nil {
28032803 t .Fatalf ("caught nil error" )
28042804 }
2805- if err .Error () != "context is done" {
2805+ if ! strings . HasPrefix ( err .Error (), "context is done" ) {
28062806 t .Fatalf ("wrong error caught: %v" , err )
28072807 }
28082808}
@@ -3295,7 +3295,7 @@ func TestClientIdRequestObjectWithPassedCanceledContext(t *testing.T) {
32953295 resp , err := conn .Do (req ).Get ()
32963296 require .Nilf (t , resp , "Response is empty" )
32973297 require .NotNilf (t , err , "Error is not empty" )
3298- require .Equal (t , err . Error () , "context is done" )
3298+ require .ErrorContains (t , err , "context is done" )
32993299}
33003300
33013301func TestConnectionProtocolInfoUnsupported (t * testing.T ) {
0 commit comments