etcd-tester: 10-second timeout for stressers

For https://github.com/coreos/etcd/issues/4477.
release-2.3
Gyu-Ho Lee 2016-02-17 15:31:24 -08:00
parent ef2d3feca6
commit 239a6d89c5
1 changed files with 4 additions and 1 deletions

View File

@ -83,7 +83,10 @@ func (s *stresser) Stress() error {
go func(i int) {
defer wg.Done()
for {
putctx, putcancel := context.WithTimeout(ctx, 5*time.Second)
// TODO: 10-second is enough timeout to cover leader failure
// and immediate leader election. Find out what other cases this
// could be timed out.
putctx, putcancel := context.WithTimeout(ctx, 10*time.Second)
_, err := kvc.Put(putctx, &pb.PutRequest{
Key: []byte(fmt.Sprintf("foo%d", rand.Intn(s.KeySuffixRange))),
Value: []byte(randStr(s.KeySize)),