44 "context"
55 "fmt"
66 "os"
7- "runtime"
87 "strings"
98 "testing"
109 "time"
@@ -27,20 +26,12 @@ func TestTimeoutConfigurationsPushNotifications(t *testing.T) {
2726
2827 var errorsDetected = false
2928 var p = func (format string , args ... interface {}) {
30- _ , filename , line , _ := runtime .Caller (1 )
31- format = "%s:%d [%s][TIMEOUT-CONFIGS] " + format + "\n "
32- ts := time .Now ().Format ("15:04:05.000" )
33- args = append ([]interface {}{filename , line , ts }, args ... )
34- fmt .Printf (format , args ... )
29+ printLog ("TIMEOUT-CONFIGS" , false , format , args ... )
3530 }
3631
3732 var e = func (format string , args ... interface {}) {
3833 errorsDetected = true
39- _ , filename , line , _ := runtime .Caller (1 )
40- format = "%s:%d [%s][TIMEOUT-CONFIGS][ERROR] " + format + "\n "
41- ts := time .Now ().Format ("15:04:05.000" )
42- args = append ([]interface {}{filename , line , ts }, args ... )
43- fmt .Printf (format , args ... )
34+ printLog ("TIMEOUT-CONFIGS" , true , format , args ... )
4435 }
4536
4637 // Test different timeout configurations
@@ -109,10 +100,8 @@ func TestTimeoutConfigurationsPushNotifications(t *testing.T) {
109100 t .Run (timeoutTest .name , func (t * testing.T ) {
110101 errorsDetected = false
111102 var ef = func (format string , args ... interface {}) {
112- format = "[%s][TIMEOUT-CONFIGS][ERROR] " + format
113- ts := time .Now ().Format ("15:04:05.000" )
114- args = append ([]interface {}{ts }, args ... )
115- t .Fatalf (format , args ... )
103+ printLog ("TIMEOUT-CONFIGS" , true , format , args ... )
104+ t .FailNow ()
116105 }
117106
118107 p ("Testing timeout configuration: %s - %s" , timeoutTest .name , timeoutTest .description )
0 commit comments