test(ci): 稳定远端 race 门禁

This commit is contained in:
tbphp committed 2026-08-11 16:32:43 +08:00
1 parent 6162826efa
commit 3e948eedbe
4 files changed
+8 -9

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
run: go build -o gpt-load .
- name: Run race-enabled tests
run: go test -race -count=1 . ./internal/...
run: go test -race -count=1 -timeout=15m . ./internal/...
- name: Check repository invariants
run: git diff --check
+1 -1
View File
@@ -109,7 +109,7 @@ jobs:
run: go build -trimpath -o gpt-load .
- name: Run race-enabled tests
run: go test -race -count=1 . ./internal/...
run: go test -race -count=1 -timeout=15m . ./internal/...
- name: Check repository invariants
run: git diff --check
+4 -5
View File
@@ -500,7 +500,7 @@ func TestEmitPersistsGatewayFrozenQuoteWithoutRepricing(t *testing.T) {
EstimatedCostNanoUSD: 1_000_000_000,
}
service.Emit(eventA)
timer := receiveValue(t, timers.created)
receiveValue(t, timers.created)
entries := processLogEntries(t, output.Bytes())
if len(entries) != 1 ||
entries[0]["cost_usd"] != "1" {
@@ -523,7 +523,9 @@ func TestEmitPersistsGatewayFrozenQuoteWithoutRepricing(t *testing.T) {
EstimatedCostNanoUSD: 2_000_000_000,
}
service.Emit(eventB)
timer.Fire()
if err := service.Stop(context.Background()); err != nil {
t.Fatalf("Stop() error = %v", err)
}
rows := receiveValue(t, writes)
if len(rows) != 2 || rows[0].ID != "snapshot-a" ||
@@ -532,7 +534,4 @@ func TestEmitPersistsGatewayFrozenQuoteWithoutRepricing(t *testing.T) {
rows[1].EstimatedCostNanoUSD != 2_000_000_000 {
t.Fatalf("snapshot-priced rows = %+v, want A/1000000000 then B/2000000000", rows)
}
if err := service.Stop(context.Background()); err != nil {
t.Fatalf("Stop() error = %v", err)
}
}
+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 . ./internal/..."},
{name: "Run race-enabled tests", run: "go test -race -count=1 -timeout=15m . ./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 . ./internal/...",
"go test -race -count=1 -timeout=15m . ./internal/...",
)
}