Files
Pulse/scripts
pulse-triage[bot] 88b0f70c62 Fix NAS live teardown race and parallelize slow monitoring tests (#5428)
**Fix NAS live teardown race and parallelize slow monitoring tests**

1. Keep TestInstallSHNASBootOwnersQuiesceBeforeRecoveryErasure serial at
   the top level in scripts/installtests/install_sh_test.go. Commit
   63023ca8e3 mistakenly added top-level t.Parallel(), violating the
   documented invariant that AgentNASLiveTeardown runs serially before
   parallel fixtures. Because AgentNASLiveTeardown inspects the real
   machine-wide process table (ps -ax), overlapping with parallel
   sibling tests that spawn pulse-agent or shell commands mentioning
   start-pulse-agent.sh, autorun.sh, or /boot/config/go caused
   read_nas_agent_removal_processes to classify them as unknown and fail
   quiesce_nas_agent_for_removal with exit code 1 (Build and Test run
   46146982565, job 140987777407). The 22 modelled AgentNASTeardown
   subtests remain parallel.

2. Cut Backend tests (rest-0 and rest-1) wall time — the slowest Go
   package in Build and Test (~452s in rest-0 and ~379s in rest-1 on
   main run 46149511431) — by adding top-level t.Parallel() to 43
   audited, global-free slow tests across 17 unclaimed
   internal/monitoring/*_test.go files (~345+ serial root test-seconds).
   - Many already used t.Parallel() on their subtests (guest agent and
     Windows polling contracts, PVE/PBS storage/inventory budget and
     response tests, severity delivery, archive writer, and alert replay
     tests) without top-level t.Parallel().
   - Parallelize the four 15-17s notification restart continuity tests
     using isolated t.TempDir() and httptest servers while keeping the
     two t.Setenv("PULSE_DATA_DIR") tests serial.
   - Parallelize TestPMGBackupReadsAvoidUnrelatedFleetCopy only when
     raceEnabled is true (isolated go test -race=false subprocess),
     keeping non-race testing.AllocsPerRun strictly serial.

Zero production code, test assertions, or timeout budgets changed.

Contract-Neutral: Test-only scheduling fix for scripts/installtests live
NAS teardown and parallelization of isolated internal/monitoring tests;
no production or subsystem contract changes.

**Speed up Vitest frontend tests via AST partitioning and setup
cleanup**

Cut Frontend unit tests wall time — the slowest required job in Build
and Test
(544-562s on recent Pulse PR runs) — without changing production builds,
runtime source, or per-file test isolation:

- Disable vite-plugin-solid HMR transforms (hot: false) in Vitest mode
and
strip its auto-injected @testing-library/jest-dom/vitest setup entry so
vitest.setup.ts owns conditional jest-dom loading (eliminating jest-dom
  setup on pure Node tests and duplicate loading on TSX tests).
- Extract setup-time regex helpers into
frontend-modern/vitest.setup.helpers.ts
so vitest.setup.ts does not import vitest.projects.ts on every test
file, and
skip registering the beforeAll locale-catalog hook when a test file uses
only
  English messages.
- Upgrade frontend-modern/vitest.projects.ts with ?raw/?url static asset
recognition and a lazy TypeScript AST export-reachability fallback that
ignores prose comments and follows only imported symbols while
conservatively
propagating ES module top-level initialization and DOM package/global
edges.
This moves 168 additional provably DOM-free .test.ts files from jsdom to
node
(465 -> 633 of 940 .test.ts files; 632 passed, 1 skipped, 13,804 tests).
- Add unit tests in vitestProjects.test.ts covering static asset
queries, prose
  comments, export-level DOM reachability, module-init propagation, and
  stripSolidAutoJestDom.

Contract-Neutral: Test-runner configuration, environment partitioning,
and test-helper unit tests only; production frontend builds, SRI, bundle
budgets, runtime behavior, and test assertions are unchanged.

**Raise lifecycle pulse-agent build timeout for contended CI shards**

PR #5419 (run 46167305741) failed Backend tests (rest-1) twice on
attempts 141049444349 and 141057010855 with:
install_sh_test.go:9828: build pulse-agent lifecycle binary: signal:
killed
  context deadline exceeded (180.04s)

Backend CI restores -race build objects, not plain non-race objects.
Cold plain compilation of ./cmd/pulse-agent needs ~250 CPU-seconds
(scripts/run-release-backend-tests.sh), which exceeds 3 minutes when
rest-1 runs internal/monitoring, internal/alerts, cmd/pulse-agent, and
scripts/installtests concurrently on a 4-vCPU runner. Because
newLifecycleBinaryFixture caches the first build result via
sync.OnceValues, that timeout failed every subsequent lifecycle test in
the shard.

Raise lifecycleAgentFixture's bounded build deadline from 3 minutes to
10 minutes while preserving the real exact-source compilation, per-test
executable copies, and fail-closed caching.

Contract-Neutral: Test-only fixture build deadline adjustment in
scripts/installtests; production code, installer behavior, and test
assertions are unchanged.

---
Fleet candidate `20261128T173925Z-delivery-trust` from the
`delivery-trust` lane. Reviewed tip
`25457f31e77730dd435e78169289cbd74b2cc16c` on `main`.

[How Pulse handles
triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
2026-11-28 18:43:14 +00:00
..
…
…
…
…
2026-11-28 00:28:19 +00:00