fix: data races in Square mock and scheduler hostname tests
CI / Env docs check (push) Successful in 12s
CI / Docker compose check (push) Successful in 14s
CI / Nginx config check (push) Successful in 17s
CI / Frontend major deps (push) Failing after 23s
CI / Frontend deps check (push) Successful in 28s
CI / Secrets scan (push) Successful in 37s
CI / Go build (push) Successful in 37s
CI / Frontend build (push) Successful in 1m6s
CI / Knip (push) Successful in 34s
CI / Frontend a11y check (push) Successful in 1m36s
CI / Go vet (prod) (push) Successful in 1m30s
CI / go mod tidy (push) Successful in 44s
CI / Go vet (dev) (push) Successful in 2m9s
CI / Frontend QC (audit) (push) Successful in 45s
CI / Go vulnerabilities (push) Successful in 1m24s
CI / Staticcheck (prod) (push) Successful in 2m55s
CI / Staticcheck (dev) (push) Successful in 3m28s
CI / golangci-lint (push) Successful in 3m29s
CI / Frontend QC (typecheck) (push) Successful in 1m26s
CI / Security scan (prod) (push) Successful in 4m22s
CI / Security scan (dev) (push) Successful in 4m23s
CI / Frontend QC (lint) (push) Successful in 1m58s
CI / Svelte strict check (push) Successful in 57s
CI / Tests (prod) (push) Successful in 4m15s
CI / Tests (dev) (push) Successful in 4m17s
CI / Race (prod) (push) Successful in 8m2s
CI / Race (dev) (push) Successful in 8m17s
CI / Env docs check (push) Successful in 12s
CI / Docker compose check (push) Successful in 14s
CI / Nginx config check (push) Successful in 17s
CI / Frontend major deps (push) Failing after 23s
CI / Frontend deps check (push) Successful in 28s
CI / Secrets scan (push) Successful in 37s
CI / Go build (push) Successful in 37s
CI / Frontend build (push) Successful in 1m6s
CI / Knip (push) Successful in 34s
CI / Frontend a11y check (push) Successful in 1m36s
CI / Go vet (prod) (push) Successful in 1m30s
CI / go mod tidy (push) Successful in 44s
CI / Go vet (dev) (push) Successful in 2m9s
CI / Frontend QC (audit) (push) Successful in 45s
CI / Go vulnerabilities (push) Successful in 1m24s
CI / Staticcheck (prod) (push) Successful in 2m55s
CI / Staticcheck (dev) (push) Successful in 3m28s
CI / golangci-lint (push) Successful in 3m29s
CI / Frontend QC (typecheck) (push) Successful in 1m26s
CI / Security scan (prod) (push) Successful in 4m22s
CI / Security scan (dev) (push) Successful in 4m23s
CI / Frontend QC (lint) (push) Successful in 1m58s
CI / Svelte strict check (push) Successful in 57s
CI / Tests (prod) (push) Successful in 4m15s
CI / Tests (dev) (push) Successful in 4m17s
CI / Race (prod) (push) Successful in 8m2s
CI / Race (dev) (push) Successful in 8m17s
- square_dev.go: return a copy of CheckoutResult to the caller instead of sharing the map-stored pointer, preventing the goroutine from racing with the caller on Status field reads - scheduler_test.go: remove t.Parallel from TestInitHostname_* tests which modify a shared package-level hostname variable
This commit is contained in:
@@ -554,8 +554,6 @@ func TestHostname_NonEmpty(t *testing.T) {
|
||||
// TestInitHostname_HappyPath verifies initHostname assigns the value from
|
||||
// the hostname resolver when it returns a valid name.
|
||||
func TestInitHostname_HappyPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
orig := hostname
|
||||
defer func() { hostname = orig }()
|
||||
|
||||
@@ -568,8 +566,6 @@ func TestInitHostname_HappyPath(t *testing.T) {
|
||||
// TestInitHostname_FallbackOnError verifies initHostname falls back to
|
||||
// "localhost" when the resolver returns an error.
|
||||
func TestInitHostname_FallbackOnError(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
orig := hostname
|
||||
defer func() { hostname = orig }()
|
||||
|
||||
@@ -582,8 +578,6 @@ func TestInitHostname_FallbackOnError(t *testing.T) {
|
||||
// TestInitHostname_FallbackOnEmpty verifies initHostname falls back to
|
||||
// "localhost" when the resolver returns an empty string (no error).
|
||||
func TestInitHostname_FallbackOnEmpty(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
orig := hostname
|
||||
defer func() { hostname = orig }()
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ func (m *MockClient) CreateCheckout(ctx context.Context, req CreateCheckoutReq)
|
||||
}
|
||||
|
||||
m.mu.Lock()
|
||||
m.checkouts[checkoutID] = result
|
||||
m.checkouts[checkoutID] = &CheckoutResult{ID: checkoutID, Status: "PENDING"}
|
||||
m.mu.Unlock()
|
||||
|
||||
if !m.HoldCheckouts {
|
||||
|
||||
Reference in New Issue
Block a user