code: func (p *Process) pingWait(addr string, timeout time.Duration) error {
  	// Default to local process if addr not specified.
  	if addr == "" {
  		addr = fmt.Sprintf("localhost:%s", p.Port)
  	}
  
  	logger := p.Logger.New("fn", "pingWait", "addr", addr, "timeout", timeout)
  
  	ticker := time.NewTicker(checkInterval)
  	defer ticker.Stop()
  
  	timer := time.NewTimer(timeout)
  	defer timer.Stop()
  
  	for {
  		select {
  		case <-timer.C:
  			return ErrTimeout
  		case <-ticker.C:
  		}
  
  		if err := p.ping(addr, timeout); err != nil {
  			logger.Error("ping error", "err", err)
  			continue
  		}
  
  		return nil
  	}
  }
docs: // pingWait continually pings a server until successful response or timeout.