[v9.4.x] SQLStore: Fix setting query retries for integration tests (#64972)

SQLStore: Fix setting query tries for integration tests (#64944)

* SQLStore: Pass testinfra database configuration to the test database

* Add test

* Bypass gocyclo check for initTestDB

(cherry picked from commit f5cb8c660e)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2023-03-17 18:05:30 +02:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent c5f4ef6c3e
commit 7e5e3d78d0
2 changed files with 28 additions and 5 deletions
+5
View File
@@ -52,6 +52,11 @@ func StartGrafanaEnv(t *testing.T, grafDir, cfgPath string) (string, *server.Tes
require.NoError(t, err)
require.NoError(t, env.SQLStore.Sync())
require.NotNil(t, env.SQLStore.Cfg)
dbSec, err := env.SQLStore.Cfg.Raw.GetSection("database")
require.NoError(t, err)
assert.Greater(t, dbSec.Key("query_retries").MustInt(), 0)
go func() {
// When the server runs, it will also build and initialize the service graph
if err := env.Server.Run(); err != nil {