• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 27434058592

12 Jun 2026 06:08PM UTC coverage: 66.637% (-0.001%) from 66.638%
27434058592

push

github

web-flow
Cover Serve-path lifecycle for AS runner, status, optimizer, health (#5506)

* Add Serve-path lifecycle test coverage

#5443 is the final Phase 2 relocation: the embedded AS runner, the
status reporter goroutine, the optimizer cleanup, and the health
monitor's Start/Stop must be driven from Serve's orchestration. The
ServerConfig fields and struct wiring for all four landed with the
Serve skeleton (#5439), and the shared (*Server).Handler/Start/Stop
drive their lifecycles once the Serve path became serveable (#5442) --
so this is a near-no-op for production, mirroring #5441.

- Add serve_lifecycle_test.go: Serve-path coverage proving a Serve-built
  *Server drives each subsystem -- health monitor disabled/started/
  stopped/start-failure (using the injected *health.Monitor, never
  constructing one), status reporter start + shutdown via shutdownFuncs,
  optimizer store cleanup on Stop, and AuthServer carried into Config.
- Sync the stale #5443 doc comments in serve.go from future ("relocated
  by the next Phase 2 task") to present tense.

server.New's signature and behavior are unchanged; the shared Stop
teardown order is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address review: leak-safe test teardown, honest names

Fixed issues from code review of the Serve-path lifecycle tests:
- HIGH: startServeInBackground now owns teardown via t.Cleanup, returning
  an idempotent sync.Once-guarded stop func, so a mid-test require failure
  can no longer leak the Start goroutine and bound HTTP listener (per
  testing.md). Removed the separate stopAndWait helper.
- MEDIUM: renamed TestServeStopClosesOptimizerStore to
  TestServeWithOptimizerStartsAndStopsCleanly and narrowed its comment to
  what it asserts (the optimizer-configured path constructs and tears down
  without error); the store.Close is internal to sessionmanager, and
  shutdownFuncs draining on Stop is observably proven by TestServeStopClosesCore.

Co-Authore... (continued)

68319 of 102524 relevant lines covered (66.64%)

63.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.42
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc