Files
Pulse/pkg
pulse-triage[bot] 5389776b3c Speed up Pulse backend CI shards and refresh internal/api weights (#5400)
**Speed up Pulse backend CI shards and refresh internal/api weights**

Refresh .github/scripts/internal-api-test-seconds.txt from the four
complete post-#5366 Build and Test runs (46124957837, 46125831000,
46125846026, 46126504079), cutting 4-shard PR peak task-seconds by 16.8s
to 54.9s in LOO-CV and narrowing spread on all four holdouts for both
4-shard PR and 5-shard main cuts.

Reuse the existing retrySleepFn test seam via skipRetrySleep(t) in seven
non-timing internal/agentupdate HTTP tests (33.05s -> 0.56s under -race;
full internal/agentupdate -race passes in 17.35s).

Add t.Parallel() to verified global-free slow timer, HTTP, retention,
AST-scan, and release-identity build tests across internal/relay,
internal/notifications, internal/unifiedresources, and cmd/pulse-agent
(all pass under go test -race -count=2, and -count=1 for
release_identity_test.go). Zero production code or test assertions
changed.

Contract-Neutral: Test-only speedups and CI shard timing refresh; no
production behavior or subsystem contract changes.

**Initialize auth stores in shard-order-sensitive internal/api tests**

TestEstablishSAMLSession panicked when refreshed internal/api shard
weights
placed it in api-3 before any test initialized the package-level session
and
CSRF stores (run 46133585552, job 140948795581). Initialize and restore
the
test auth stores via useSAMLTestAuthStores(t) in
TestEstablishSAMLSession
and newHostedAuthzTestRouter so both suites remain self-contained
regardless
of shard cut boundaries.

Contract-Neutral: Test-only initialization fix for existing internal/api
unit tests; no production behavior or subsystem contract changes.

**Parallelize isolated slow tests in pkg/metrics and internal/alerts**

Cut Backend tests (rest-0 and rest-1) wall time — the slowest job in
Build and Test — by adding t.Parallel() to verified global-free slow
tests in two unclaimed heavy packages (rebuilding 83fe43cd52 with all
internal/mock parallelizations removed because mock fixture helpers and
cadence tests share package-level globals):

- pkg/metrics (rest-0): silence zerolog/log.Logger once in TestMain
  (pkg/metrics/testmain_test.go) so parallel tests never mutate
  log.Logger concurrently while keeping the serial log-capture test,
  startupMaintenanceHook/metricsClusteredMigrationHook tests, and all
  TestSLO_* latency tests strictly serial.
- internal/alerts (rest-1): add t.Parallel() to 14 isolated slow tests
  (including subprocess parents and subtests in storage_crash_test.go
  and pending_resource_collection_test.go) while keeping
  zerolog.SetGlobalLevel and SetMetricHooks tests serial.

Zero production code, test assertions, or internal/mock files changed.

Contract-Neutral: Test-only parallelization in pkg/metrics and
internal/alerts; no production behavior or subsystem contract changes.

---
Fleet candidate `20261128T131012Z-delivery-trust` from the
`delivery-trust` lane. Reviewed tip
`86dc31b006845733630081c98ef62c3acef4b760` on `main`.

[How Pulse handles
triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
2026-11-28 15:01:12 +00:00
..