Chore: add query_retries=3 to querylibrary_integration_test.go (#57607)

This commit is contained in:
Artur Wierzbicki 2022-10-25 21:52:56 +08:00 committed by GitHub
parent cc820062c6
commit a63c529ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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
}