Skip to content

Commit

Permalink
Don't log test initial test daemon ping failures
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cpuguy83 committed Jul 12, 2019
1 parent c7d1908 commit 15675e2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions internal/test/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
defer cancel()

// make sure daemon is ready to receive requests
for {
for i := 0; ; i++ {
d.log.Logf("[%s] waiting for daemon to start", d.id)

select {
Expand All @@ -325,9 +325,14 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {

resp, err := client.Do(req.WithContext(rctx))
if err != nil {
d.log.Logf("[%s] error pinging daemon on start: %v", d.id, err)

time.Sleep(500 * time.Millisecond)
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)
}

select {
case <-ctx.Done():
case <-time.After(500 * time.Microsecond):
}
continue
}

Expand Down

0 comments on commit 15675e2

Please sign in to comment.