Chore: Remove context.TODO() from services (#42555)

* Remove context.TODO() from services

* Fix live test
This commit is contained in:
idafurjes
2021-12-20 17:05:33 +01:00
committed by GitHub
parent 6f8e651cdb
commit ff3cf94b56
23 changed files with 78 additions and 75 deletions

View File

@@ -72,7 +72,7 @@ func TestWhenAlertManagerShouldNotify(t *testing.T) {
evalContext.Rule.State = tc.newState
res := am.ShouldNotify(context.TODO(), evalContext, &models.AlertNotificationState{})
res := am.ShouldNotify(context.Background(), evalContext, &models.AlertNotificationState{})
if res != tc.expect {
t.Errorf("got %v expected %v", res, tc.expect)
}

View File

@@ -257,7 +257,7 @@ func TestSendSlackRequest(t *testing.T) {
require.NoError(t, err)
slackNotifier := not.(*SlackNotifier)
err = slackNotifier.sendRequest(context.TODO(), []byte("test"))
err = slackNotifier.sendRequest(context.Background(), []byte("test"))
if !test.expectError {
require.NoError(tt, err)
} else {