diff options
Diffstat (limited to 'lib/go/thrift/simple_server_test.go')
-rw-r--r-- | lib/go/thrift/simple_server_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/go/thrift/simple_server_test.go b/lib/go/thrift/simple_server_test.go index b92d50f01..e0cf151b9 100644 --- a/lib/go/thrift/simple_server_test.go +++ b/lib/go/thrift/simple_server_test.go @@ -287,3 +287,15 @@ func TestStopTimeoutWithSocketTimeout(t *testing.T) { t.Fatalf("error when stop server:%v", err) } } + +func TestErrAbandonRequest(t *testing.T) { + if !errors.Is(ErrAbandonRequest, ErrAbandonRequest) { + t.Error("errors.Is(ErrAbandonRequest, ErrAbandonRequest) returned false") + } + if !errors.Is(ErrAbandonRequest, context.Canceled) { + t.Error("errors.Is(ErrAbandonRequest, context.Canceled) returned false") + } + if errors.Is(context.Canceled, ErrAbandonRequest) { + t.Error("errors.Is(context.Canceled, ErrAbandonRequest) returned true") + } +} |