From d808b4686c76ba0c7fe0a4bf454698937cd501aa Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:03:25 -0800 Subject: [PATCH 1/5] raft: fix typo in raft_test.go Signed-off-by: Gyuho Lee --- raft/raft_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raft/raft_test.go b/raft/raft_test.go index c93935fb7..5ae49bc56 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -722,7 +722,7 @@ func TestLearnerLogReplication(t *testing.T) { match := n1.getProgress(2).Match if match != n2.raftLog.committed { - t.Errorf("progresss 2 of leader 1 wants match %d, but got %d", n2.raftLog.committed, match) + t.Errorf("progress 2 of leader 1 wants match %d, but got %d", n2.raftLog.committed, match) } } From bab0223f0441433470b9c4d10bc69998db288fca Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:03:43 -0800 Subject: [PATCH 2/5] ctlv3: fix typo in check command Signed-off-by: Gyuho Lee --- etcdctl/ctlv3/command/check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcdctl/ctlv3/command/check.go b/etcdctl/ctlv3/command/check.go index 204721f66..e347af295 100644 --- a/etcdctl/ctlv3/command/check.go +++ b/etcdctl/ctlv3/command/check.go @@ -269,7 +269,7 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) { func NewCheckDatascaleCommand() *cobra.Command { cmd := &cobra.Command{ Use: "datascale [options]", - Short: "Check the memory usage of holding data for diferent workloads on a given server endpoint.", + Short: "Check the memory usage of holding data for different workloads on a given server endpoint.", Long: "If no endpoint is provided, localhost will be used. If multiple endpoints are provided, first endpoint will be used.", Run: newCheckDatascaleCommand, } From ab339786463fc970fac12ba270869120c787b170 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:03:54 -0800 Subject: [PATCH 3/5] etcd-tester: fix spell check warnings Signed-off-by: Gyuho Lee --- tools/functional-tester/etcd-tester/main.go | 2 +- tools/functional-tester/etcd-tester/stresser.go | 4 ++-- tools/functional-tester/etcd-tester/tester.go | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/functional-tester/etcd-tester/main.go b/tools/functional-tester/etcd-tester/main.go index 5f5853206..82adb362f 100644 --- a/tools/functional-tester/etcd-tester/main.go +++ b/tools/functional-tester/etcd-tester/main.go @@ -56,7 +56,7 @@ func main() { stressQPS := flag.Int("stress-qps", 10000, "maximum number of stresser requests per second.") schedCases := flag.String("schedule-cases", "", "test case schedule") consistencyCheck := flag.Bool("consistency-check", true, "true to check consistency (revision, hash)") - stresserType := flag.String("stresser", "keys,lease", "comma separated list of stressers (keys, lease, v2keys, nop, election-runner, watch-runner, lock-racer-runner, lease-runner).") + stresserType := flag.String("stresser", "keys,lease", "comma separated list of stressing clients (keys, lease, v2keys, nop, election-runner, watch-runner, lock-racer-runner, lease-runner).") etcdRunnerPath := flag.String("etcd-runner", "", "specify a path of etcd runner binary") failureTypes := flag.String("failures", "default,failpoints", "specify failures (concat of \"default\" and \"failpoints\").") failpoints := flag.String("failpoints", `panic("etcd-tester")`, `comma separated list of failpoint terms to inject (e.g. 'panic("etcd-tester"),1*sleep(1000)')`) diff --git a/tools/functional-tester/etcd-tester/stresser.go b/tools/functional-tester/etcd-tester/stresser.go index bf0d88214..9c3bddb7c 100644 --- a/tools/functional-tester/etcd-tester/stresser.go +++ b/tools/functional-tester/etcd-tester/stresser.go @@ -51,7 +51,7 @@ func (s *nopStresser) ModifiedKeys() int64 { func (s *nopStresser) Checker() Checker { return nil } // compositeStresser implements a Stresser that runs a slice of -// stressers concurrently. +// stressing clients concurrently. type compositeStresser struct { stressers []Stresser } @@ -141,7 +141,7 @@ func NewStresser(s string, sc *stressConfig, m *member) Stresser { case "nop": return &nopStresser{start: time.Now(), qps: int(sc.rateLimiter.Limit())} case "keys": - // TODO: Too intensive stressers can panic etcd member with + // TODO: Too intensive stressing clients can panic etcd member with // 'out of memory' error. Put rate limits in server side. return &keyStresser{ Endpoint: m.grpcAddr(), diff --git a/tools/functional-tester/etcd-tester/tester.go b/tools/functional-tester/etcd-tester/tester.go index 6a0c72af5..6c910ed83 100644 --- a/tools/functional-tester/etcd-tester/tester.go +++ b/tools/functional-tester/etcd-tester/tester.go @@ -245,26 +245,26 @@ func (tt *tester) cleanup() error { } func (tt *tester) pauseStresser() { - plog.Infof("%s pausing the stressers...", tt.logPrefix()) + plog.Infof("%s pausing the stressing clients...", tt.logPrefix()) tt.stresser.Pause() - plog.Infof("%s paused stressers", tt.logPrefix()) + plog.Infof("%s paused stressing clients", tt.logPrefix()) } func (tt *tester) startStresser() (err error) { - plog.Infof("%s starting the stressers...", tt.logPrefix()) + plog.Infof("%s starting the stressing clients...", tt.logPrefix()) err = tt.stresser.Stress() - plog.Infof("%s started stressers", tt.logPrefix()) + plog.Infof("%s started stressing clients", tt.logPrefix()) return err } func (tt *tester) closeStresser() { - plog.Infof("%s closing the stressers...", tt.logPrefix()) + plog.Infof("%s closing the stressing clients...", tt.logPrefix()) tt.stresser.Close() - plog.Infof("%s closed stressers", tt.logPrefix()) + plog.Infof("%s closed stressing clients", tt.logPrefix()) } func (tt *tester) resetStressCheck() error { - plog.Infof("%s resetting stressers and checkers...", tt.logPrefix()) + plog.Infof("%s resetting stressing clients and checkers...", tt.logPrefix()) cs := &compositeStresser{} for _, m := range tt.cluster.Members { s := NewStresser(tt.stresserType, &tt.scfg, m) From 9c9d846959ba1e4a0f17221806261ffbc1cdb4f1 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:05:24 -0800 Subject: [PATCH 4/5] clientv3util: fix govet warning Signed-off-by: Gyuho Lee --- clientv3/clientv3util/example_key_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientv3/clientv3util/example_key_test.go b/clientv3/clientv3util/example_key_test.go index 8b30ae5c8..48b20c732 100644 --- a/clientv3/clientv3util/example_key_test.go +++ b/clientv3/clientv3util/example_key_test.go @@ -22,7 +22,7 @@ import ( "github.com/coreos/etcd/clientv3/clientv3util" ) -func ExampleKeyExists_put() { +func ExampleKeyMissing() { cli, err := clientv3.New(clientv3.Config{ Endpoints: []string{"127.0.0.1:2379"}, }) @@ -45,7 +45,7 @@ func ExampleKeyExists_put() { } } -func ExampleKeyExists_delete() { +func ExampleKeyExists() { cli, err := clientv3.New(clientv3.Config{ Endpoints: []string{"127.0.0.1:2379"}, }) From ebfba72715b4135fb1aa9a16fce5cde9a0c77f9f Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:07:18 -0800 Subject: [PATCH 5/5] client: fix "ineffassign" warning Signed-off-by: Gyuho Lee --- client/client_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index 5e547a8cd..20bcf2d86 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -483,8 +483,14 @@ func (f fakeCancelContext) Done() <-chan struct{} { func (f fakeCancelContext) Err() error { return fakeCancelContextError } func (f fakeCancelContext) Value(key interface{}) interface{} { return 1 } -func withTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { - return parent, func() { parent = nil } +func withTimeout(parent context.Context, timeout time.Duration) ( + ctx context.Context, + cancel context.CancelFunc) { + ctx = parent + cancel = func() { + ctx = nil + } + return ctx, cancel } func TestHTTPClusterClientDoCanceledContext(t *testing.T) {