mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Support context.Context in Loki interface (#61979)
This commit adds support for canceleable contexts in the Loki interface.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package historian
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
@@ -21,7 +22,7 @@ func TestLokiHTTPClient(t *testing.T) {
|
||||
}, log.NewNopLogger())
|
||||
|
||||
// Unauthorized request should fail against Grafana Cloud.
|
||||
err = client.ping()
|
||||
err = client.ping(context.Background())
|
||||
require.Error(t, err)
|
||||
|
||||
client.cfg.BasicAuthUser = "<your_username>"
|
||||
@@ -32,7 +33,7 @@ func TestLokiHTTPClient(t *testing.T) {
|
||||
// client.cfg.TenantID = "<your_tenant_id>"
|
||||
|
||||
// Authorized request should fail against Grafana Cloud.
|
||||
err = client.ping()
|
||||
err = client.ping(context.Background())
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user