Don't log test initial test daemon ping failures

This is just noise due to timing. I picked `> 2` just based on
logs from tests I've seen there's always 1 or 2.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 15675e28f1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Brian Goff 2019-07-12 09:51:32 -07:00 committed by Sebastiaan van Stijn
parent ad8327f2ce
commit 05c096a1ac
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -321,7 +321,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
defer cancel() defer cancel()
// make sure daemon is ready to receive requests // make sure daemon is ready to receive requests
for { for i := 0; ; i++ {
d.log.Logf("[%s] waiting for daemon to start", d.id) d.log.Logf("[%s] waiting for daemon to start", d.id)
select { select {
@ -335,9 +335,14 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
resp, err := client.Do(req.WithContext(rctx)) resp, err := client.Do(req.WithContext(rctx))
if err != nil { if err != nil {
d.log.Logf("[%s] error pinging daemon on start: %v", d.id, err) if i > 2 { // don't log the first couple, this ends up just being noise
d.log.Logf("[%s] error pinging daemon on start: %v", d.id, err)
}
time.Sleep(500 * time.Millisecond) select {
case <-ctx.Done():
case <-time.After(500 * time.Microsecond):
}
continue continue
} }