mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
7611128e57
issue: #33285 - add adaptor to implement walimpls into wal interface. - implement timetick sorted and filtering scanner. - add test for wal. --------- Signed-off-by: chyezh <chyezh@outlook.com>
20 lines
586 B
Go
20 lines
586 B
Go
package status
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
func TestIsCanceled(t *testing.T) {
|
|
assert.False(t, IsCanceled(nil))
|
|
assert.True(t, IsCanceled(context.DeadlineExceeded))
|
|
assert.True(t, IsCanceled(context.Canceled))
|
|
assert.True(t, IsCanceled(status.Error(codes.Canceled, "test")))
|
|
assert.True(t, IsCanceled(ConvertStreamingError("test", status.Error(codes.Canceled, "test"))))
|
|
assert.False(t, IsCanceled(ConvertStreamingError("test", status.Error(codes.Unknown, "test"))))
|
|
}
|