Merge pull request #4472 from gyuho/f0

etcd-tester: count success for v3
release-2.3
Gyu-Ho Lee 2016-02-09 17:16:06 -08:00
commit 3b8237d011
1 changed files with 6 additions and 1 deletions

View File

@ -56,6 +56,8 @@ type stresser struct {
wg *sync.WaitGroup wg *sync.WaitGroup
cancel func() cancel func()
conn *grpc.ClientConn conn *grpc.ClientConn
success int
} }
func (s *stresser) Stress() error { func (s *stresser) Stress() error {
@ -90,6 +92,9 @@ func (s *stresser) Stress() error {
if err != nil { if err != nil {
return return
} }
s.mu.Lock()
s.success++
s.mu.Unlock()
} }
}(i) }(i)
} }
@ -111,7 +116,7 @@ func (s *stresser) Report() (int, int) {
s.mu.Lock() s.mu.Lock()
defer s.mu.Unlock() defer s.mu.Unlock()
// TODO: find a better way to report v3 tests // TODO: find a better way to report v3 tests
return -1, -1 return s.success, -1
} }
type stresserV2 struct { type stresserV2 struct {