From 350673f1f8c2a6f49f7d85a85573470755333db9 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Tue, 7 Jun 2016 21:53:36 -0700 Subject: [PATCH] etcd-tester: retry for 'etcdserver: not capable' Fix https://github.com/coreos/etcd/issues/5573. Currently stresser starts at the same time as cluster start. If the stresser got launched too fast/early, all stressers exit from the error 'etcdserver: not capable', which means the cluster is not ready yet. This adds additional error checking, so stresser can retry. --- tools/functional-tester/etcd-tester/stresser.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/functional-tester/etcd-tester/stresser.go b/tools/functional-tester/etcd-tester/stresser.go index 472f9df64..44dd6e39c 100644 --- a/tools/functional-tester/etcd-tester/stresser.go +++ b/tools/functional-tester/etcd-tester/stresser.go @@ -26,6 +26,7 @@ import ( clientV2 "github.com/coreos/etcd/client" "github.com/coreos/etcd/etcdserver" + "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "golang.org/x/net/context" "google.golang.org/grpc" @@ -112,6 +113,9 @@ func (s *stresser) Stress() error { case transport.ErrConnClosing.Desc: // server closed the transport (failure injected node) shouldContinue = true + case rpctypes.ErrNotCapable.Error(): + // capability check has not been done (in the beginning) + shouldContinue = true // default: // errors from stresser.Cancel method: