mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 01:32:00 +01:00
Address the #1 product-repo output constraint in signals/output-constraints.json (`PR checks (Pulse)`, 19.1m median / 44.8m p90) by removing real-clock idle waits and serial test bottlenecks across five slow backend packages on the `Backend tests (rest-*)` and `Unified Agent Native Verification` critical paths: - `internal/websocket/hub_test.go`: run `TestClientWriterRevalidatesIdleConnection` inside `testing/synctest` over an in-memory buffered `net.Conn` listener so the real production `client.writePump()` 30-second ping ticker and policy withdrawal run in virtual time (`30.00s` -> `0.00s` under `-race`). Add `t.Parallel()` to 87 verified global-free tests across 10 files (keeping `setAuditLogger`, `log.Logger`, and `SetGlobalLevel` tests serial). - `internal/truenas/transport_test.go`: run `TestAuthenticatedRPCSurvivesIdleTransportTimeout` inside `testing/synctest` over an in-memory buffered TLS `net.Conn` listener via `client.outboundDialContext` so the real 30-second keepalive ticker, 35-second idle deadline, and 40-second idle wait run in virtual time (`40.02s` -> `0.02s` under `-race`). Add `t.Parallel()` to 98 verified global-free tests across 3 files (keeping `captureRPCCloseLogs` and `t.Setenv` tests serial). - `internal/unifiedresources/*_test.go` (14 files): add `t.Parallel()` to 294 verified global-free tests across the slowest serial test files so they run concurrently and overlap with `TestRetentionLoop_RunsInitialPrune`'s 30s wait (keeping `AllocsPerRun`, `mock.SetEnabled`, and `t.Setenv` files serial). - `pkg/proxmox/*_test.go` (4 files): add `t.Parallel()` to caller-budget and context-cancellation tests and subtests (keeping `log.Logger` tests serial and leaving human-claimed `ha_status_test.go` untouched). - `scripts/installtests/*_test.go` (17 files): add `t.Parallel()` to 110 verified isolated tests (including `agent_url_admission_test.go` and its 8 subtests; leaving human-claimed `build_release_assets_test.go` / `root_install_sh_test.go`, `guidance_recipe_runner_test.go`, and serial `TestInstallSHNASBootOwnersQuiesceBeforeRecoveryErasure` untouched). Zero production code or test assertions changed. Contract-Neutral: Test-only virtual-time (testing/synctest) and t.Parallel() execution speedups; no production behavior or subsystem contract changes. Change-source: pulse-maintainer