Browse Source

fix: mute until success

pull/171/head
Ben Meier 1 year ago
parent
commit
6454487cfe
Failed to extract signature
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      integration_test.go

+ 8
- 5
integration_test.go View File

@ -40,11 +40,13 @@ func waitForHealthyAmqp(t *testing.T, connStr string) *Conn {
defer cancel()
tkr := time.NewTicker(time.Second)
// only log connection-level logs when verbose is enabled
connLogger := simpleLogF(func(s string, i ...interface{}) {})
if testing.Verbose() {
connLogger = simpleLogF(t.Logf)
}
// only log connection-level logs when connection has succeeded
muted := true
connLogger := simpleLogF(func(s string, i ...interface{}) {
if !muted {
t.Logf(s, i...)
}
})
var lastErr error
for {
@ -71,6 +73,7 @@ func waitForHealthyAmqp(t *testing.T, connStr string) *Conn {
t.Log("publish ping failed", err.Error())
} else {
t.Log("ping successful")
muted = true
return conn
}
}


Loading…
Cancel
Save