diff --git a/pkg/services/querylibrary/tests/common.go b/pkg/services/querylibrary/tests/common.go index 9083fa59012..c3aaf3734d9 100644 --- a/pkg/services/querylibrary/tests/common.go +++ b/pkg/services/querylibrary/tests/common.go @@ -57,6 +57,7 @@ func createTestContext(t *testing.T) testContext { dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{ EnableFeatureToggles: []string{featuremgmt.FlagPanelTitleSearch, featuremgmt.FlagQueryLibrary}, + QueryRetries: 3, }) grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path) diff --git a/pkg/tests/testinfra/testinfra.go b/pkg/tests/testinfra/testinfra.go index f01a03227e3..ed897a4b1a6 100644 --- a/pkg/tests/testinfra/testinfra.go +++ b/pkg/tests/testinfra/testinfra.go @@ -314,6 +314,12 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) { _, err = logSection.NewKey("address", o.GRPCServerAddress) require.NoError(t, err) } + if o.QueryRetries != 0 { + logSection, err := getOrCreateSection("database") + require.NoError(t, err) + _, err = logSection.NewKey("query_retries", fmt.Sprintf("%d", o.QueryRetries)) + require.NoError(t, err) + } } cfgPath := filepath.Join(cfgDir, "test.ini") @@ -345,4 +351,5 @@ type GrafanaOpts struct { UnifiedAlertingDisabledOrgs []int64 EnableLog bool GRPCServerAddress string + QueryRetries int64 }