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

pull/57616/head
Artur Wierzbicki 3 years ago committed by GitHub
parent cc820062c6
commit a63c529ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/services/querylibrary/tests/common.go
  2. 7
      pkg/tests/testinfra/testinfra.go

@ -57,6 +57,7 @@ func createTestContext(t *testing.T) testContext {
dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{ dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{featuremgmt.FlagPanelTitleSearch, featuremgmt.FlagQueryLibrary}, EnableFeatureToggles: []string{featuremgmt.FlagPanelTitleSearch, featuremgmt.FlagQueryLibrary},
QueryRetries: 3,
}) })
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path) grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)

@ -314,6 +314,12 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
_, err = logSection.NewKey("address", o.GRPCServerAddress) _, err = logSection.NewKey("address", o.GRPCServerAddress)
require.NoError(t, err) 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") cfgPath := filepath.Join(cfgDir, "test.ini")
@ -345,4 +351,5 @@ type GrafanaOpts struct {
UnifiedAlertingDisabledOrgs []int64 UnifiedAlertingDisabledOrgs []int64
EnableLog bool EnableLog bool
GRPCServerAddress string GRPCServerAddress string
QueryRetries int64
} }

Loading…
Cancel
Save