Merge pull request #4549 from gyuho/path

functional-tester: remove log prefixes
This commit is contained in:
Gyu-Ho Lee 2016-02-17 19:05:07 -08:00
commit cf71b64286
3 changed files with 46 additions and 46 deletions

View File

@ -34,10 +34,10 @@ func (a *Agent) serveRPC(port string) {
} }
func (a *Agent) RPCStart(args []string, pid *int) error { func (a *Agent) RPCStart(args []string, pid *int) error {
plog.Printf("rpc: start etcd with args %v", args) plog.Printf("start etcd with args %v", args)
err := a.start(args...) err := a.start(args...)
if err != nil { if err != nil {
plog.Println("rpc: error starting etcd", err) plog.Println("error starting etcd", err)
return err return err
} }
*pid = a.cmd.Process.Pid *pid = a.cmd.Process.Pid
@ -45,20 +45,20 @@ func (a *Agent) RPCStart(args []string, pid *int) error {
} }
func (a *Agent) RPCStop(args struct{}, reply *struct{}) error { func (a *Agent) RPCStop(args struct{}, reply *struct{}) error {
plog.Printf("rpc: stop etcd") plog.Printf("stop etcd")
err := a.stop() err := a.stop()
if err != nil { if err != nil {
plog.Println("rpc: error stopping etcd", err) plog.Println("error stopping etcd", err)
return err return err
} }
return nil return nil
} }
func (a *Agent) RPCRestart(args struct{}, pid *int) error { func (a *Agent) RPCRestart(args struct{}, pid *int) error {
plog.Printf("rpc: restart etcd") plog.Printf("restart etcd")
err := a.restart() err := a.restart()
if err != nil { if err != nil {
plog.Println("rpc: error restarting etcd", err) plog.Println("error restarting etcd", err)
return err return err
} }
*pid = a.cmd.Process.Pid *pid = a.cmd.Process.Pid
@ -66,38 +66,38 @@ func (a *Agent) RPCRestart(args struct{}, pid *int) error {
} }
func (a *Agent) RPCCleanup(args struct{}, reply *struct{}) error { func (a *Agent) RPCCleanup(args struct{}, reply *struct{}) error {
plog.Printf("rpc: cleanup etcd") plog.Printf("cleanup etcd")
err := a.cleanup() err := a.cleanup()
if err != nil { if err != nil {
plog.Println("rpc: error cleaning up etcd", err) plog.Println("error cleaning up etcd", err)
return err return err
} }
return nil return nil
} }
func (a *Agent) RPCTerminate(args struct{}, reply *struct{}) error { func (a *Agent) RPCTerminate(args struct{}, reply *struct{}) error {
plog.Printf("rpc: terminate etcd") plog.Printf("terminate etcd")
err := a.terminate() err := a.terminate()
if err != nil { if err != nil {
plog.Println("rpc: error terminating etcd", err) plog.Println("error terminating etcd", err)
} }
return nil return nil
} }
func (a *Agent) RPCDropPort(port int, reply *struct{}) error { func (a *Agent) RPCDropPort(port int, reply *struct{}) error {
plog.Printf("rpc: drop port %d", port) plog.Printf("drop port %d", port)
err := a.dropPort(port) err := a.dropPort(port)
if err != nil { if err != nil {
plog.Println("rpc: error dropping port", err) plog.Println("error dropping port", err)
} }
return nil return nil
} }
func (a *Agent) RPCRecoverPort(port int, reply *struct{}) error { func (a *Agent) RPCRecoverPort(port int, reply *struct{}) error {
plog.Printf("rpc: recover port %d", port) plog.Printf("recover port %d", port)
err := a.recoverPort(port) err := a.recoverPort(port)
if err != nil { if err != nil {
plog.Println("rpc: error recovering port", err) plog.Println("error recovering port", err)
} }
return nil return nil
} }

View File

@ -251,7 +251,7 @@ func (c *cluster) Status() ClusterStatus {
desc := c.agentEndpoints[i] desc := c.agentEndpoints[i]
if err != nil { if err != nil {
cs.AgentStatuses[desc] = client.Status{State: "unknown"} cs.AgentStatuses[desc] = client.Status{State: "unknown"}
plog.Printf("etcd-tester: failed to get the status of agent [%s]", desc) plog.Printf("failed to get the status of agent [%s]", desc)
} }
cs.AgentStatuses[desc] = s cs.AgentStatuses[desc] = s
} }

View File

@ -45,49 +45,49 @@ func (tt *tester) runLoop() {
tt.status.setCase(j) tt.status.setCase(j)
if err := tt.cluster.WaitHealth(); err != nil { if err := tt.cluster.WaitHealth(); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] wait full health error: %v", i, j, err) plog.Printf("[round#%d case#%d] wait full health error: %v", i, j, err)
if err := tt.cleanup(i, j); err != nil { if err := tt.cleanup(i, j); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] cleanup error: %v", i, j, err) plog.Printf("[round#%d case#%d] cleanup error: %v", i, j, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] start failure %s", i, j, f.Desc()) plog.Printf("[round#%d case#%d] start failure %s", i, j, f.Desc())
plog.Printf("etcd-tester: [round#%d case#%d] start injecting failure...", i, j) plog.Printf("[round#%d case#%d] start injecting failure...", i, j)
if err := f.Inject(tt.cluster, i); err != nil { if err := f.Inject(tt.cluster, i); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] injection error: %v", i, j, err) plog.Printf("[round#%d case#%d] injection error: %v", i, j, err)
if err := tt.cleanup(i, j); err != nil { if err := tt.cleanup(i, j); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] cleanup error: %v", i, j, err) plog.Printf("[round#%d case#%d] cleanup error: %v", i, j, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] injected failure", i, j) plog.Printf("[round#%d case#%d] injected failure", i, j)
plog.Printf("etcd-tester: [round#%d case#%d] start recovering failure...", i, j) plog.Printf("[round#%d case#%d] start recovering failure...", i, j)
if err := f.Recover(tt.cluster, i); err != nil { if err := f.Recover(tt.cluster, i); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] recovery error: %v", i, j, err) plog.Printf("[round#%d case#%d] recovery error: %v", i, j, err)
if err := tt.cleanup(i, j); err != nil { if err := tt.cleanup(i, j); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] cleanup error: %v", i, j, err) plog.Printf("[round#%d case#%d] cleanup error: %v", i, j, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] recovered failure", i, j) plog.Printf("[round#%d case#%d] recovered failure", i, j)
if tt.cluster.v2Only { if tt.cluster.v2Only {
plog.Printf("etcd-tester: [round#%d case#%d] succeed!", i, j) plog.Printf("[round#%d case#%d] succeed!", i, j)
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] canceling the stressers...", i, j) plog.Printf("[round#%d case#%d] canceling the stressers...", i, j)
for _, s := range tt.cluster.Stressers { for _, s := range tt.cluster.Stressers {
s.Cancel() s.Cancel()
} }
plog.Printf("etcd-tester: [round#%d case#%d] canceled stressers", i, j) plog.Printf("[round#%d case#%d] canceled stressers", i, j)
plog.Printf("etcd-tester: [round#%d case#%d] checking current revisions...", i, j) plog.Printf("[round#%d case#%d] checking current revisions...", i, j)
var ( var (
revs map[string]int64 revs map[string]int64
hashes map[string]int64 hashes map[string]int64
@ -99,55 +99,55 @@ func (tt *tester) runLoop() {
revs, hashes, rerr = tt.cluster.getRevisionHash() revs, hashes, rerr = tt.cluster.getRevisionHash()
if rerr != nil { if rerr != nil {
plog.Printf("etcd-tester: [round#%d case#%d.%d] failed to get current revisions (%v)", i, j, k, rerr) plog.Printf("[round#%d case#%d.%d] failed to get current revisions (%v)", i, j, k, rerr)
continue continue
} }
if currentRevision, ok = getSameValue(revs); ok { if currentRevision, ok = getSameValue(revs); ok {
break break
} }
plog.Printf("etcd-tester: [round#%d case#%d.%d] inconsistent current revisions %+v", i, j, k, revs) plog.Printf("[round#%d case#%d.%d] inconsistent current revisions %+v", i, j, k, revs)
} }
if !ok || rerr != nil { if !ok || rerr != nil {
plog.Printf("etcd-tester: [round#%d case#%d] checking current revisions failed (%v)", i, j, revs) plog.Printf("[round#%d case#%d] checking current revisions failed (%v)", i, j, revs)
if err := tt.cleanup(i, j); err != nil { if err := tt.cleanup(i, j); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] cleanup error: %v", i, j, err) plog.Printf("[round#%d case#%d] cleanup error: %v", i, j, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] all members are consistent with current revisions", i, j) plog.Printf("[round#%d case#%d] all members are consistent with current revisions", i, j)
plog.Printf("etcd-tester: [round#%d case#%d] checking current storage hashes...", i, j) plog.Printf("[round#%d case#%d] checking current storage hashes...", i, j)
if _, ok = getSameValue(hashes); !ok { if _, ok = getSameValue(hashes); !ok {
plog.Printf("etcd-tester: [round#%d case#%d] checking current storage hashes failed (%v)", i, j, hashes) plog.Printf("[round#%d case#%d] checking current storage hashes failed (%v)", i, j, hashes)
if err := tt.cleanup(i, j); err != nil { if err := tt.cleanup(i, j); err != nil {
plog.Printf("etcd-tester: [round#%d case#%d] cleanup error: %v", i, j, err) plog.Printf("[round#%d case#%d] cleanup error: %v", i, j, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d case#%d] all members are consistent with storage hashes", i, j) plog.Printf("[round#%d case#%d] all members are consistent with storage hashes", i, j)
plog.Printf("etcd-tester: [round#%d case#%d] restarting the stressers...", i, j) plog.Printf("[round#%d case#%d] restarting the stressers...", i, j)
for _, s := range tt.cluster.Stressers { for _, s := range tt.cluster.Stressers {
go s.Stress() go s.Stress()
} }
plog.Printf("etcd-tester: [round#%d case#%d] succeed!", i, j) plog.Printf("[round#%d case#%d] succeed!", i, j)
} }
revToCompact := max(0, currentRevision-10000) revToCompact := max(0, currentRevision-10000)
plog.Printf("etcd-tester: [round#%d] compacting storage at %d (current revision %d)", i, revToCompact, currentRevision) plog.Printf("[round#%d] compacting storage at %d (current revision %d)", i, revToCompact, currentRevision)
if err := tt.cluster.compactKV(revToCompact); err != nil { if err := tt.cluster.compactKV(revToCompact); err != nil {
plog.Printf("etcd-tester: [round#%d] compactKV error (%v)", i, err) plog.Printf("[round#%d] compactKV error (%v)", i, err)
if err := tt.cleanup(i, 0); err != nil { if err := tt.cleanup(i, 0); err != nil {
plog.Printf("etcd-tester: [round#%d] cleanup error: %v", i, err) plog.Printf("[round#%d] cleanup error: %v", i, err)
return return
} }
continue continue
} }
plog.Printf("etcd-tester: [round#%d] compacted storage", i) plog.Printf("[round#%d] compacted storage", i)
// TODO: make sure compaction is finished // TODO: make sure compaction is finished
time.Sleep(30 * time.Second) time.Sleep(30 * time.Second)
@ -158,7 +158,7 @@ func (tt *tester) cleanup(i, j int) error {
roundFailedTotalCounter.Inc() roundFailedTotalCounter.Inc()
caseFailedTotalCounter.WithLabelValues(tt.failures[j].Desc()).Inc() caseFailedTotalCounter.WithLabelValues(tt.failures[j].Desc()).Inc()
plog.Printf("etcd-tester: [round#%d case#%d] cleaning up...", i, j) plog.Printf("[round#%d case#%d] cleaning up...", i, j)
if err := tt.cluster.Cleanup(); err != nil { if err := tt.cluster.Cleanup(); err != nil {
return err return err
} }