Chore: Remove context.TODO() (#43409)
* Remove context.TODO() from services * Fix live test * Remove context.TODO
This commit is contained in:
@@ -223,7 +223,7 @@ func Test_executeQueryErrorWithDifferentLogAnalyticsCreds(t *testing.T) {
|
||||
"azureLogAnalyticsSameAs": false,
|
||||
},
|
||||
}
|
||||
ctx := context.TODO()
|
||||
ctx := context.Background()
|
||||
query := &AzureLogAnalyticsQuery{
|
||||
Params: url.Values{},
|
||||
TimeRange: backend.TimeRange{},
|
||||
|
||||
@@ -143,7 +143,7 @@ func Test_newMux(t *testing.T) {
|
||||
},
|
||||
}
|
||||
mux := s.newMux()
|
||||
res, err := mux.QueryData(context.TODO(), &backend.QueryDataRequest{
|
||||
res, err := mux.QueryData(context.Background(), &backend.QueryDataRequest{
|
||||
PluginContext: backend.PluginContext{},
|
||||
Queries: []backend.DataQuery{
|
||||
{QueryType: tt.queryType},
|
||||
|
||||
@@ -121,7 +121,7 @@ func TestTimeSeriesQuery(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("End time before start time should result in error", func(t *testing.T) {
|
||||
_, err := executor.executeTimeSeriesQuery(context.TODO(), &backend.QueryDataRequest{Queries: []backend.DataQuery{{TimeRange: backend.TimeRange{
|
||||
_, err := executor.executeTimeSeriesQuery(context.Background(), &backend.QueryDataRequest{Queries: []backend.DataQuery{{TimeRange: backend.TimeRange{
|
||||
From: now.Add(time.Hour * -1),
|
||||
To: now.Add(time.Hour * -2),
|
||||
}}}})
|
||||
@@ -129,7 +129,7 @@ func TestTimeSeriesQuery(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("End time equals start time should result in error", func(t *testing.T) {
|
||||
_, err := executor.executeTimeSeriesQuery(context.TODO(), &backend.QueryDataRequest{Queries: []backend.DataQuery{{TimeRange: backend.TimeRange{
|
||||
_, err := executor.executeTimeSeriesQuery(context.Background(), &backend.QueryDataRequest{Queries: []backend.DataQuery{{TimeRange: backend.TimeRange{
|
||||
From: now.Add(time.Hour * -1),
|
||||
To: now.Add(time.Hour * -1),
|
||||
}}}})
|
||||
|
||||
Reference in New Issue
Block a user