Browse Source

Merge pull request #2599 from yichengq/etcd-tester

tools/etcd-agent: stop etcd only if it is running when cleanup
Xiang Li 10 years ago
parent
commit
ee2833111d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tools/functional-tester/etcd-agent/agent.go

+ 3 - 0
tools/functional-tester/etcd-agent/agent.go

@@ -73,6 +73,9 @@ func (a *Agent) start(args ...string) error {
 
 
 // stop stops the existing etcd process the agent started.
 // stop stops the existing etcd process the agent started.
 func (a *Agent) stop() error {
 func (a *Agent) stop() error {
+	if a.state != stateStarted {
+		return nil
+	}
 	err := a.cmd.Process.Kill()
 	err := a.cmd.Process.Kill()
 	if err != nil {
 	if err != nil {
 		return err
 		return err