mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-23 19:06:33 +00:00
fce3023bc5
The internal/server suite ran almost fully serially (only 1 of 113 test files used t.Parallel). The CI -race flake (BUG-1913) is structurally fixed via the copy-once storetest template DB, but the suite regrows toward the -timeout budget as it grows serially. Add t.Parallel() as the first line of every top-level Test* func in the four heaviest files — handlers_items, handlers_oauth, handlers_mcp, handlers_dashboard (159 tests). All build on isolated per-test fixtures (testServer / oauthEnabledTestServer, both backed by storetest.NewSQLite, which copies a fresh template DB into t.TempDir per call), so each test owns its DB, rate limiters, and event bus. Deliberately left serial: t.Run subtests that share the parent's server+workspace and mutate the same rows (e.g. the PatchItem subtests all PATCH one seeded item) — parallelizing those would race. The goroutine-count / timing-sensitive tests in server_test.go are untouched. go test -race ./internal/server/ stays clean (7m16s, exit 0). Claude-Session: https://claude.ai/code/session_015yuBJQYfDj95cgX3DaD8SF