@@ -2731,7 +2731,7 @@ func TestClientRequestObjectsWithPassedCanceledContext(t *testing.T) {
2731
2731
req := NewPingRequest ().Context (ctx )
2732
2732
cancel ()
2733
2733
resp , err := conn .Do (req ).Get ()
2734
- if err .Error () != "context is done" {
2734
+ if ! strings . HasPrefix ( err .Error (), "context is done" ) {
2735
2735
t .Fatalf ("Failed to catch an error from done context" )
2736
2736
}
2737
2737
if resp != nil {
@@ -2802,7 +2802,7 @@ func TestClientRequestObjectsWithContext(t *testing.T) {
2802
2802
if err == nil {
2803
2803
t .Fatalf ("caught nil error" )
2804
2804
}
2805
- if err .Error () != "context is done" {
2805
+ if ! strings . HasPrefix ( err .Error (), "context is done" ) {
2806
2806
t .Fatalf ("wrong error caught: %v" , err )
2807
2807
}
2808
2808
}
@@ -3295,7 +3295,7 @@ func TestClientIdRequestObjectWithPassedCanceledContext(t *testing.T) {
3295
3295
resp , err := conn .Do (req ).Get ()
3296
3296
require .Nilf (t , resp , "Response is empty" )
3297
3297
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" )
3299
3299
}
3300
3300
3301
3301
func TestConnectionProtocolInfoUnsupported (t * testing.T ) {
0 commit comments