clientv3/integration: tests with new errors

release-3.0
Gyu-Ho Lee 2016-04-29 11:03:37 -07:00
parent 6049c95dc9
commit b3ebe66c97
3 changed files with 5 additions and 7 deletions

View File

@ -411,7 +411,7 @@ func TestKVCompact(t *testing.T) {
}
err = kv.Compact(ctx, 7)
if err == nil || err != rpctypes.ErrCompacted {
t.Fatalf("error got %v, want %v", err, rpctypes.ErrFutureRev)
t.Fatalf("error got %v, want %v", err, rpctypes.ErrCompacted)
}
wcli := clus.RandClient()

View File

@ -23,11 +23,9 @@ import (
"github.com/coreos/etcd/integration"
"github.com/coreos/etcd/pkg/testutil"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
func TestLeastNotFoundError(t *testing.T) {
func TestLeaseNotFoundError(t *testing.T) {
defer testutil.AfterTest(t)
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1})
@ -113,8 +111,8 @@ func TestLeaseKeepAliveOnce(t *testing.T) {
}
_, err = lapi.KeepAliveOnce(context.Background(), clientv3.LeaseID(0))
if grpc.Code(err) != codes.NotFound {
t.Errorf("invalid error returned %v", err)
if err != rpctypes.ErrLeaseNotFound {
t.Errorf("expected %v, got %v", rpctypes.ErrLeaseNotFound, err)
}
}

View File

@ -364,7 +364,7 @@ func TestWatchCompactRevision(t *testing.T) {
t.Fatalf("expected wresp, but got closed channel")
}
if wresp.Err() != rpctypes.ErrCompacted {
t.Fatalf("wresp.Err() expected ErrCompacteed, but got %v", wresp.Err())
t.Fatalf("wresp.Err() expected %v, but got %v", rpctypes.ErrCompacted, wresp.Err())
}
// ensure the channel is closed