mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
add too many retries test case
This commit is contained in:
parent
9b35ca3a52
commit
5fde52a403
@ -108,7 +108,7 @@ func TestCheckCluster(t *testing.T) {
|
||||
c := &clientWithResp{rs: rs}
|
||||
d := discovery{cluster: cluster, id: 1, c: c}
|
||||
|
||||
cRetry := &clientWithRetry{failTimes: 2}
|
||||
cRetry := &clientWithRetry{failTimes: 3}
|
||||
cRetry.rs = rs
|
||||
dRetry := discovery{cluster: cluster, id: 1, c: cRetry, timeoutTimescale: time.Millisecond * 2}
|
||||
|
||||
@ -294,6 +294,16 @@ func TestSortableNodes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRetryFailure(t *testing.T) {
|
||||
cluster := "1000"
|
||||
c := &clientWithRetry{failTimes: 4}
|
||||
d := discovery{cluster: cluster, id: 1, c: c, timeoutTimescale: time.Millisecond * 2}
|
||||
_, _, err := d.checkCluster()
|
||||
if err != ErrTooManyRetries {
|
||||
t.Errorf("err = %v, want %v", err, ErrTooManyRetries)
|
||||
}
|
||||
}
|
||||
|
||||
type clientWithResp struct {
|
||||
rs []*client.Response
|
||||
w client.Watcher
|
||||
|
Loading…
x
Reference in New Issue
Block a user