test: check Telegram notifier close errors
Test and build / Test and build (push) Successful in 2m15s
Test and build / Test and build (push) Successful in 2m15s
This commit is contained in:
1 file changed
+10
-2
@@ -86,7 +86,11 @@ func TestNewTelegramUsesConfiguredQueueSize(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer notifier.Close()
|
defer func() {
|
||||||
|
if err := notifier.Close(); err != nil {
|
||||||
|
t.Errorf("close notifier: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
telegram, ok := notifier.(*Telegram)
|
telegram, ok := notifier.(*Telegram)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -122,7 +126,11 @@ func TestTelegramSendTimeoutAuditsMustDeliverFailure(t *testing.T) {
|
|||||||
}
|
}
|
||||||
telegram := notifier.(*Telegram)
|
telegram := notifier.(*Telegram)
|
||||||
telegram.retryDelay = func(error, int) time.Duration { return time.Millisecond }
|
telegram.retryDelay = func(error, int) time.Duration { return time.Millisecond }
|
||||||
defer notifier.Close()
|
defer func() {
|
||||||
|
if err := notifier.Close(); err != nil {
|
||||||
|
t.Errorf("close notifier: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if err := notifier.Alert(context.Background(), "critical"); err != nil {
|
if err := notifier.Alert(context.Background(), "critical"); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|||||||
Reference in new issue
Block a user