milvus/internal/util/streamingutil/status/checker_test.go
chyezh 7611128e57
enhance: wal adaptor implementation (#34122)
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>
2024-07-04 15:23:08 +08:00

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"))))
}