test(ci): reduce race gate overhead (#688)

This commit is contained in:
tbphp authored and GitHub committed 2026-09-18 13:05:49 +08:00
1 parent f6e3a15c40
commit e9a10bb509
5 files changed
+16 -4

No files matched your search

+1 -1
View File
@@ -79,7 +79,7 @@ jobs:
cache: false
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
run: go test -race -vet=off -count=1 -timeout=15m . ./internal/...
race-cpa:
runs-on: [self-hosted, Linux, ARM64]
+1 -1
View File
@@ -223,7 +223,7 @@ jobs:
cache: false
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
run: go test -race -vet=off -count=1 -timeout=15m . ./internal/...
race-cpa:
needs: validate-tag
@@ -9,6 +9,8 @@ import (
)
func TestAffinityKindMigrationContract(t *testing.T) {
t.Parallel()
testAffinityKindMigration(t, openInternalMigrationTestDatabase)
}
func TestExternalAffinityKindMigrationContract(t *testing.T) {
@@ -22,6 +24,9 @@ func testAffinityKindMigration(t *testing.T, open func(*testing.T) *gorm.DB) {
for _, scenario := range []string{"fresh", "upgrade", "interrupted"} {
t.Run(scenario, func(t *testing.T) {
db := open(t)
if db.Dialector.Name() == "sqlite" {
t.Parallel()
}
if scenario != "fresh" {
if err := applyMigrationRegistry(db, migrations[:13]); err != nil {
t.Fatal(err)
@@ -11,6 +11,8 @@ import (
)
func TestQuotaHistoryMigrationCreatesQueryableHistory(t *testing.T) {
t.Parallel()
db := openInternalMigrationTestDatabase(t)
if err := applyMigrations(db); err != nil {
t.Fatal(err)
@@ -29,6 +31,8 @@ func TestQuotaHistoryMigrationCreatesQueryableHistory(t *testing.T) {
}
func TestQuotaHistoryMigrationContract(t *testing.T) {
t.Parallel()
testQuotaHistoryMigration(t, openInternalMigrationTestDatabase)
}
@@ -44,6 +48,9 @@ func testQuotaHistoryMigration(t *testing.T, open func(*testing.T) *gorm.DB) {
for _, scenario := range []string{"fresh", "upgrade", "interrupted"} {
t.Run(scenario, func(t *testing.T) {
db := open(t)
if db.Dialector.Name() == "sqlite" {
t.Parallel()
}
if scenario != "fresh" {
if err := applyMigrationRegistry(db, migrations[:15]); err != nil {
t.Fatal(err)
+2 -2
View File
@@ -195,7 +195,7 @@ func TestBranchAndReleaseWorkflowsRunRaceInParallelGates(t *testing.T) {
t,
workflowJobBlock(t, content, "race-tests"),
"Run race-enabled tests",
"go test -race -count=1 -timeout=15m . ./internal/...",
"go test -race -vet=off -count=1 -timeout=15m . ./internal/...",
)
branchCPA := workflowStepBlock(
t,
@@ -224,7 +224,7 @@ func TestBranchAndReleaseWorkflowsRunRaceInParallelGates(t *testing.T) {
t,
workflowJobBlock(t, releaseContent, "race-tests"),
"Run race-enabled tests",
"go test -race -count=1 -timeout=15m . ./internal/...",
"go test -race -vet=off -count=1 -timeout=15m . ./internal/...",
)
releaseCPA := workflowStepBlock(
t,