fix(ci): 稳定 race 测试门禁

This commit is contained in:
tbphp committed 2026-08-16 11:31:03 +08:00
1 parent 338b1423dc
commit 6ddbf5b56d
4 files changed
+8 -6

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ permissions:
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 20
timeout-minutes: 40
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -48,7 +48,7 @@ jobs:
run: go build -o gpt-load .
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
run: go test -race -count=1 -timeout=30m . ./internal/...
- name: Check repository invariants
run: git diff --check
+2 -2
View File
@@ -75,7 +75,7 @@ jobs:
verify-and-build-web:
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 30
timeout-minutes: 40
steps:
- name: Checkout tag commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -109,7 +109,7 @@ jobs:
run: go build -trimpath -o gpt-load .
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
run: go test -race -count=1 -timeout=30m . ./internal/...
- name: Check repository invariants
run: git diff --check
@@ -8,6 +8,7 @@ import (
"net/http/httptest"
"sync/atomic"
"testing"
"time"
"gpt-load/internal/execution"
)
@@ -75,6 +76,7 @@ func TestAzureErrorDoesNotExposeStructuredCredentialSecrets(t *testing.T) {
spec.ChannelID = "azure_openai"
spec.TargetConfig = json.RawMessage(`{"endpoint":"` + server.URL + `"}`)
spec.Credential = execution.NewCredentialSnapshot(32, 1, 1, []byte(`{"api_key":"`+azureKey+`"}`))
spec.Timeouts.Request = 5 * time.Second
spec = freezeTestAttempt(spec)
result := runtime.Execute(context.Background(), spec)
+2 -2
View File
@@ -69,7 +69,7 @@ func TestBranchCIContainsStaticGoAndRaceEnabledBackendGates(t *testing.T) {
{name: "Check module graph", run: "go mod tidy -diff"},
{name: "Audit Go dependencies", run: "go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 ./..."},
{name: "Run Go vet", run: "go vet ./..."},
{name: "Run race-enabled tests", run: "go test -race -count=1 -timeout=15m . ./internal/..."},
{name: "Run race-enabled tests", run: "go test -race -count=1 -timeout=30m . ./internal/..."},
{name: "Check repository invariants", run: "git diff --check"},
} {
assertWorkflowGateStep(t, testJob, test.name, test.run)
@@ -84,7 +84,7 @@ func TestBranchCIContainsStaticGoAndRaceEnabledBackendGates(t *testing.T) {
t,
releaseJob,
"Run race-enabled tests",
"go test -race -count=1 -timeout=15m . ./internal/...",
"go test -race -count=1 -timeout=30m . ./internal/...",
)
}