From 4e296fa9ec1f48b8d4092becfc847c7cdb6aeb9c Mon Sep 17 00:00:00 2001 From: Rafael Bortolon Paulovic Date: Thu, 23 Oct 2025 14:08:39 +0200 Subject: [PATCH] fix: sqlite nocgo with ionice and parallel flag (#112849) * chore: log test DB path * fix: run sqlite_nocgo with parallel 4 and ionice to reduce IO operations --- .github/workflows/pr-test-integration.yml | 3 ++- pkg/tests/testinfra/testinfra.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test-integration.yml b/.github/workflows/pr-test-integration.yml index 8e66f838a79..7e7545bead0 100644 --- a/.github/workflows/pr-test-integration.yml +++ b/.github/workflows/pr-test-integration.yml @@ -101,7 +101,8 @@ jobs: run: | set -euo pipefail readarray -t PACKAGES <<< "$(./scripts/ci/backend-tests/pkgs-with-tests-named.sh -b TestIntegration | ./scripts/ci/backend-tests/shard.sh -N"$SHARD" -d-)" - CGO_ENABLED=0 go test -tags=sqlite -timeout=8m -run '^TestIntegration' "${PACKAGES[@]}" + # ionice since tests are IO intensive + CGO_ENABLED=0 ionice -c2 -n7 go test -p=4 -tags=sqlite -timeout=8m -run '^TestIntegration' "${PACKAGES[@]}" mysql: needs: detect-changes if: needs.detect-changes.outputs.changed == 'true' diff --git a/pkg/tests/testinfra/testinfra.go b/pkg/tests/testinfra/testinfra.go index c0d8166a5a8..b680cae8060 100644 --- a/pkg/tests/testinfra/testinfra.go +++ b/pkg/tests/testinfra/testinfra.go @@ -103,7 +103,7 @@ func StartGrafanaEnv(t *testing.T, grafDir, cfgPath string) (string, *server.Tes dbCfg.Key("password").SetValue(testDB.Password) dbCfg.Key("name").SetValue(testDB.Database) - t.Log("Using test database", "type", testDB.DriverName, "host", testDB.Host, "port", testDB.Port, "user", testDB.User, "name", testDB.Database) + t.Log("Using test database", "type", testDB.DriverName, "host", testDB.Host, "port", testDB.Port, "user", testDB.User, "name", testDB.Database, "path", testDB.Path) env, err := server.InitializeForTest(ctx, t, t, cfg, serverOpts, apiServerOpts) require.NoError(t, err)