-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: remaining errors.Is conversions #18634
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,6 +17,7 @@ package e2e | |||||
import ( | ||||||
"context" | ||||||
"encoding/json" | ||||||
"errors" | ||||||
"fmt" | ||||||
"io" | ||||||
"reflect" | ||||||
|
@@ -193,7 +194,7 @@ func getMemberList(cx ctlCtx, serializable bool) (etcdserverpb.MemberListRespons | |||||
|
||||||
resp := etcdserverpb.MemberListResponse{} | ||||||
dec := json.NewDecoder(strings.NewReader(txt)) | ||||||
if err := dec.Decode(&resp); err == io.EOF { | ||||||
if err := dec.Decode(&resp); errors.Is(err, io.EOF) { | ||||||
return etcdserverpb.MemberListResponse{}, err | ||||||
} | ||||||
return resp, nil | ||||||
|
@@ -221,7 +222,7 @@ func memberListWithHexTest(cx ctlCtx) { | |||||
} | ||||||
hexResp := etcdserverpb.MemberListResponse{} | ||||||
dec := json.NewDecoder(strings.NewReader(txt)) | ||||||
if err := dec.Decode(&hexResp); err == io.EOF { | ||||||
if err := dec.Decode(&hexResp); errors.Is(err, io.EOF) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
cx.t.Fatalf("memberListWithHexTest error (%v)", err) | ||||||
} | ||||||
num := len(resp.Members) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,6 +17,7 @@ package e2e | |||||
import ( | ||||||
"context" | ||||||
"encoding/json" | ||||||
"errors" | ||||||
"fmt" | ||||||
"io" | ||||||
"os" | ||||||
|
@@ -156,7 +157,7 @@ func getSnapshotStatus(cx ctlCtx, fpath string) (snapshot.Status, error) { | |||||
|
||||||
resp := snapshot.Status{} | ||||||
dec := json.NewDecoder(strings.NewReader(txt)) | ||||||
if err := dec.Decode(&resp); err == io.EOF { | ||||||
if err := dec.Decode(&resp); errors.Is(err, io.EOF) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return snapshot.Status{}, err | ||||||
} | ||||||
return resp, nil | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package concurrency_test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"fmt" | ||||||
"log" | ||||||
|
||||||
|
@@ -64,7 +65,7 @@ func ExampleMutex_TryLock() { | |||||
if err = m2.TryLock(context.TODO()); err == nil { | ||||||
log.Fatal("should not acquire lock") | ||||||
} | ||||||
if err == concurrency.ErrLocked { | ||||||
if errors.Is(err, concurrency.ErrLocked) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fmt.Println("cannot acquire lock for s2, as already locked in another session") | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,6 +18,7 @@ package connectivity_test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"testing" | ||||||
"time" | ||||||
|
||||||
|
@@ -113,7 +114,7 @@ func TestBalancerUnderBlackholeKeepAliveWatch(t *testing.T) { | |||||
func TestBalancerUnderBlackholeNoKeepAlivePut(t *testing.T) { | ||||||
testBalancerUnderBlackholeNoKeepAlive(t, func(cli *clientv3.Client, ctx context.Context) error { | ||||||
_, err := cli.Put(ctx, "foo", "bar") | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || err == rpctypes.ErrTimeout { | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || errors.Is(err, rpctypes.ErrTimeout) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return errExpected | ||||||
} | ||||||
return err | ||||||
|
@@ -123,7 +124,7 @@ func TestBalancerUnderBlackholeNoKeepAlivePut(t *testing.T) { | |||||
func TestBalancerUnderBlackholeNoKeepAliveDelete(t *testing.T) { | ||||||
testBalancerUnderBlackholeNoKeepAlive(t, func(cli *clientv3.Client, ctx context.Context) error { | ||||||
_, err := cli.Delete(ctx, "foo") | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || err == rpctypes.ErrTimeout { | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || errors.Is(err, rpctypes.ErrTimeout) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return errExpected | ||||||
} | ||||||
return err | ||||||
|
@@ -136,7 +137,7 @@ func TestBalancerUnderBlackholeNoKeepAliveTxn(t *testing.T) { | |||||
If(clientv3.Compare(clientv3.Version("foo"), "=", 0)). | ||||||
Then(clientv3.OpPut("foo", "bar")). | ||||||
Else(clientv3.OpPut("foo", "baz")).Commit() | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || err == rpctypes.ErrTimeout { | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || errors.Is(err, rpctypes.ErrTimeout) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return errExpected | ||||||
} | ||||||
return err | ||||||
|
@@ -146,7 +147,7 @@ func TestBalancerUnderBlackholeNoKeepAliveTxn(t *testing.T) { | |||||
func TestBalancerUnderBlackholeNoKeepAliveLinearizableGet(t *testing.T) { | ||||||
testBalancerUnderBlackholeNoKeepAlive(t, func(cli *clientv3.Client, ctx context.Context) error { | ||||||
_, err := cli.Get(ctx, "a") | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || err == rpctypes.ErrTimeout { | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || errors.Is(err, rpctypes.ErrTimeout) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return errExpected | ||||||
} | ||||||
return err | ||||||
|
@@ -207,7 +208,7 @@ func testBalancerUnderBlackholeNoKeepAlive(t *testing.T, op func(*clientv3.Clien | |||||
cancel() | ||||||
if err == nil { | ||||||
break | ||||||
} else if err == errExpected { | ||||||
} else if errors.Is(err, errExpected) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Logf("#%d: current error %v", i, err) | ||||||
} else { | ||||||
t.Errorf("#%d: failed with error %v", i, err) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -35,7 +35,7 @@ var errExpected = errors.New("expected error") | |||||
|
||||||
func isErrorExpected(err error) bool { | ||||||
return clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || | ||||||
err == rpctypes.ErrTimeout || err == rpctypes.ErrTimeoutDueToLeaderFail | ||||||
errors.Is(err, rpctypes.ErrTimeout) || errors.Is(err, rpctypes.ErrTimeoutDueToLeaderFail) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
// TestBalancerUnderNetworkPartitionPut tests when one member becomes isolated, | ||||||
|
@@ -145,7 +145,7 @@ func testBalancerUnderNetworkPartition(t *testing.T, op func(*clientv3.Client, c | |||||
if err == nil { | ||||||
break | ||||||
} | ||||||
if err != errExpected { | ||||||
if !errors.Is(err, errExpected) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Errorf("#%d: expected '%v', got '%v'", i, errExpected, err) | ||||||
} | ||||||
// give enough time for endpoint switch | ||||||
|
@@ -267,7 +267,7 @@ func testBalancerUnderNetworkPartitionWatch(t *testing.T, isolateLeader bool) { | |||||
if len(ev.Events) != 0 { | ||||||
t.Fatal("expected no event") | ||||||
} | ||||||
if err = ev.Err(); err != rpctypes.ErrNoLeader { | ||||||
if err = ev.Err(); !errors.Is(err, rpctypes.ErrNoLeader) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", rpctypes.ErrNoLeader, err) | ||||||
} | ||||||
case <-time.After(integration2.RequestWaitTimeout): // enough time to detect leader lost | ||||||
|
@@ -313,7 +313,7 @@ func TestDropReadUnderNetworkPartition(t *testing.T) { | |||||
ctx, cancel := context.WithTimeout(context.TODO(), 10*time.Second) | ||||||
_, err = kvc.Get(ctx, "a") | ||||||
cancel() | ||||||
if err != rpctypes.ErrLeaderChanged { | ||||||
if !errors.Is(err, rpctypes.ErrLeaderChanged) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", rpctypes.ErrLeaderChanged, err) | ||||||
} | ||||||
|
||||||
|
@@ -322,7 +322,7 @@ func TestDropReadUnderNetworkPartition(t *testing.T) { | |||||
_, err = kvc.Get(ctx, "a") | ||||||
cancel() | ||||||
if err != nil { | ||||||
if err == rpctypes.ErrTimeout { | ||||||
if errors.Is(err, rpctypes.ErrTimeout) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<-time.After(time.Second) | ||||||
i++ | ||||||
continue | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,6 +17,7 @@ package connectivity_test | |||||
import ( | ||||||
"bytes" | ||||||
"context" | ||||||
"errors" | ||||||
"fmt" | ||||||
"testing" | ||||||
"time" | ||||||
|
@@ -101,7 +102,7 @@ func TestBalancerUnderServerShutdownWatch(t *testing.T) { | |||||
if err == nil { | ||||||
break | ||||||
} | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || err == rpctypes.ErrTimeout || err == rpctypes.ErrTimeoutDueToLeaderFail { | ||||||
if clientv3test.IsClientTimeout(err) || clientv3test.IsServerCtxTimeout(err) || errors.Is(err, rpctypes.ErrTimeout) || errors.Is(err, rpctypes.ErrTimeoutDueToLeaderFail) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
continue | ||||||
} | ||||||
t.Fatal(err) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package recipes_test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"sync" | ||||||
"testing" | ||||||
"time" | ||||||
|
@@ -149,7 +150,7 @@ func TestDoubleBarrierTooManyClients(t *testing.T) { | |||||
// no any other client can enter the barrier. | ||||||
wgEntered.Wait() | ||||||
t.Log("Try to enter into double barrier") | ||||||
if err = b.Enter(); err != recipe.ErrTooManyClients { | ||||||
if err = b.Enter(); !errors.Is(err, recipe.ErrTooManyClients) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Errorf("Unexcepted error, expected: ErrTooManyClients, got: %v", err) | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package recipes_test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"fmt" | ||||||
"math/rand" | ||||||
"sync" | ||||||
|
@@ -139,7 +140,7 @@ func testMutexTryLock(t *testing.T, lockers int, chooseClient func() *clientv3.C | |||||
case <-ctx.Done(): | ||||||
t.Errorf("Thread: %v, Context failed: %v", i, err) | ||||||
} | ||||||
} else if err == concurrency.ErrLocked { | ||||||
} else if errors.Is(err, concurrency.ErrLocked) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
select { | ||||||
case notlockedC <- m: | ||||||
case <-ctx.Done(): | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package lease_test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"fmt" | ||||||
"math/rand" | ||||||
"reflect" | ||||||
|
@@ -895,7 +896,7 @@ func TestLeasingTxnCancel(t *testing.T) { | |||||
time.Sleep(100 * time.Millisecond) | ||||||
cancel() | ||||||
}() | ||||||
if _, err := lkv2.Txn(ctx).Then(clientv3.OpPut("k", "v")).Commit(); err != context.Canceled { | ||||||
if _, err := lkv2.Txn(ctx).Then(clientv3.OpPut("k", "v")).Commit(); !errors.Is(err, context.Canceled) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", context.Canceled, err) | ||||||
} | ||||||
} | ||||||
|
@@ -2017,7 +2018,7 @@ func TestLeasingSessionExpireCancel(t *testing.T) { | |||||
|
||||||
select { | ||||||
case err := <-errc: | ||||||
if err != ctx.Err() { | ||||||
if !errors.Is(err, ctx.Err()) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Errorf("#%d: expected %v of server unavailable, got %v", i, ctx.Err(), err) | ||||||
} | ||||||
case <-time.After(5 * time.Second): | ||||||
|
@@ -2048,7 +2049,7 @@ func waitForExpireAck(t *testing.T, kv clientv3.KV) { | |||||
ctx, cancel := context.WithTimeout(context.TODO(), time.Second) | ||||||
_, err := kv.Get(ctx, "abc") | ||||||
cancel() | ||||||
if err == ctx.Err() { | ||||||
if errors.Is(err, ctx.Err()) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return | ||||||
} else if err != nil { | ||||||
t.Logf("current error: %v", err) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,6 +18,7 @@ import ( | |||||
"bytes" | ||||||
"context" | ||||||
"crypto/sha256" | ||||||
"errors" | ||||||
"fmt" | ||||||
"io" | ||||||
"math" | ||||||
|
@@ -135,7 +136,7 @@ func TestMaintenanceMoveLeader(t *testing.T) { | |||||
|
||||||
cli := clus.Client(targetIdx) | ||||||
_, err := cli.MoveLeader(context.Background(), target) | ||||||
if err != rpctypes.ErrNotLeader { | ||||||
if !errors.Is(err, rpctypes.ErrNotLeader) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("error expected %v, got %v", rpctypes.ErrNotLeader, err) | ||||||
} | ||||||
|
||||||
|
@@ -186,7 +187,7 @@ func TestMaintenanceSnapshotCancel(t *testing.T) { | |||||
|
||||||
cancel() | ||||||
_, err = io.Copy(io.Discard, rc1) | ||||||
if err != context.Canceled { | ||||||
if !errors.Is(err, context.Canceled) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Errorf("expected %v, got %v", context.Canceled, err) | ||||||
} | ||||||
} | ||||||
|
@@ -303,7 +304,7 @@ func testMaintenanceSnapshotErrorInflight(t *testing.T, snapshot func(context.Co | |||||
close(donec) | ||||||
}() | ||||||
_, err = io.Copy(io.Discard, rc1) | ||||||
if err != nil && err != context.Canceled { | ||||||
if err != nil && !errors.Is(err, context.Canceled) { | ||||||
t.Errorf("expected %v, got %v", context.Canceled, err) | ||||||
} | ||||||
<-donec | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -89,7 +89,7 @@ func TestDetectKvOrderViolation(t *testing.T) { | |||||
t.Logf("Quering m2 after restart") | ||||||
v, err = orderingKv.Get(ctx, "foo", clientv3.WithSerializable()) | ||||||
t.Logf("Quering m2 returned: v:%v err:%v ", v, err) | ||||||
if err != errOrderViolation { | ||||||
if !errors.Is(err, errOrderViolation) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got err:%v v:%v", errOrderViolation, err, v) | ||||||
} | ||||||
} | ||||||
|
@@ -155,7 +155,7 @@ func TestDetectTxnOrderViolation(t *testing.T) { | |||||
cli.SetEndpoints(clus.Members[2].GRPCURL) | ||||||
time.Sleep(2 * time.Second) // FIXME: Figure out how pause SetEndpoints sufficiently that this is not needed | ||||||
_, err = orderingKv.Get(ctx, "foo", clientv3.WithSerializable()) | ||||||
if err != errOrderViolation { | ||||||
if !errors.Is(err, errOrderViolation) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", errOrderViolation, err) | ||||||
} | ||||||
orderingTxn = orderingKv.Txn(ctx) | ||||||
|
@@ -164,7 +164,7 @@ func TestDetectTxnOrderViolation(t *testing.T) { | |||||
).Then( | ||||||
clientv3.OpGet("foo", clientv3.WithSerializable()), | ||||||
).Commit() | ||||||
if err != errOrderViolation { | ||||||
if !errors.Is(err, errOrderViolation) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", errOrderViolation, err) | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package clientv3test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"testing" | ||||||
"time" | ||||||
|
||||||
|
@@ -78,7 +79,7 @@ func TestEndpointSwitchResolvesViolation(t *testing.T) { | |||||
cli.SetEndpoints(clus.Members[2].GRPCURL) | ||||||
time.Sleep(1 * time.Second) // give enough time for the operation | ||||||
_, err = orderingKv.Get(ctx, "foo", clientv3.WithSerializable()) | ||||||
if err != ordering.ErrNoGreaterRev { | ||||||
if !errors.Is(err, ordering.ErrNoGreaterRev) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatal("While speaking to partitioned leader, we should get ErrNoGreaterRev error") | ||||||
} | ||||||
|
||||||
|
@@ -156,7 +157,7 @@ func TestUnresolvableOrderViolation(t *testing.T) { | |||||
time.Sleep(1 * time.Second) // give enough time for operation | ||||||
|
||||||
_, err = OrderingKv.Get(ctx, "foo", clientv3.WithSerializable()) | ||||||
if err != ordering.ErrNoGreaterRev { | ||||||
if !errors.Is(err, ordering.ErrNoGreaterRev) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", ordering.ErrNoGreaterRev, err) | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ package clientv3test | |||||
|
||||||
import ( | ||||||
"context" | ||||||
"errors" | ||||||
"fmt" | ||||||
"testing" | ||||||
"time" | ||||||
|
@@ -36,7 +37,7 @@ func TestTxnError(t *testing.T) { | |||||
ctx := context.TODO() | ||||||
|
||||||
_, err := kv.Txn(ctx).Then(clientv3.OpPut("foo", "bar1"), clientv3.OpPut("foo", "bar2")).Commit() | ||||||
if err != rpctypes.ErrDuplicateKey { | ||||||
if !errors.Is(err, rpctypes.ErrDuplicateKey) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", rpctypes.ErrDuplicateKey, err) | ||||||
} | ||||||
|
||||||
|
@@ -45,7 +46,7 @@ func TestTxnError(t *testing.T) { | |||||
ops[i] = clientv3.OpPut(fmt.Sprintf("foo%d", i), "") | ||||||
} | ||||||
_, err = kv.Txn(ctx).Then(ops...).Commit() | ||||||
if err != rpctypes.ErrTooManyOps { | ||||||
if !errors.Is(err, rpctypes.ErrTooManyOps) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
t.Fatalf("expected %v, got %v", rpctypes.ErrTooManyOps, err) | ||||||
} | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.