Skip to content

Commit

Permalink
tools: don't test idle timeout if previous test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Feb 14, 2022
1 parent f9bb245 commit 46757fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func ProbServerTimeout(addr string) error {
}
_, err = conn.ReadMsg()
if err != nil {
return fmt.Errorf("failed to read probe #%d msg response: %v", i, err)
return fmt.Errorf("failed to read #%d probe msg response: %v", i, err)
}
}
return nil
Expand Down Expand Up @@ -151,7 +151,7 @@ func ProbServerTimeout(addr string) error {
conn.SetDeadline(time.Now().Add(time.Second * 10))
m, err := conn.ReadMsg()
if err != nil {
return false, fmt.Errorf("failed to read probe #%d msg response: %v", i, err)
return false, fmt.Errorf("failed to read #%d probe msg response: %v", i, err)
}

mlog.S().Infof("#%d response received, latency: %d ms", m.Id, time.Since(start).Milliseconds())
Expand Down Expand Up @@ -195,6 +195,7 @@ func ProbServerTimeout(addr string) error {
mlog.S().Info("testing basic connection reuse")
if err := testBasicReuse(); err != nil {
mlog.S().Infof("× test failed: %v", err)
return nil // bypass the following tests if the basic test failed.
} else {
mlog.S().Info("√ basic connection reuse test passed")
}
Expand Down

0 comments on commit 46757fc

Please # to comment.