Browse Source

clientv3/integration: test "rpctypes.ErrLeaseTTLTooLarge"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
3e69dc5a7c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      clientv3/integration/lease_test.go

+ 5 - 0
clientv3/integration/lease_test.go

@@ -55,6 +55,11 @@ func TestLeaseGrant(t *testing.T) {
 
 
 	kv := clus.RandClient()
 	kv := clus.RandClient()
 
 
+	_, merr := lapi.Grant(context.Background(), clientv3.MaxLeaseTTL+1)
+	if merr != rpctypes.ErrLeaseTTLTooLarge {
+		t.Fatalf("err = %v, want %v", merr, rpctypes.ErrLeaseTTLTooLarge)
+	}
+
 	resp, err := lapi.Grant(context.Background(), 10)
 	resp, err := lapi.Grant(context.Background(), 10)
 	if err != nil {
 	if err != nil {
 		t.Errorf("failed to create lease %v", err)
 		t.Errorf("failed to create lease %v", err)