Files
netbird/tools
Maycon SantosandClaude Fable 5.1 81c23086de [management] Add a go test -json summarizer and log test store setup time
The Management / Unit (mysql) job hit the 20 minute go test budget in
management/server and left only a goroutine dump of several thousand
leaked goroutines, with the "running tests:" header far out of reach of
the job log viewer. The last live test goroutine was runnable, not
blocked: the suite was still progressing when the alarm fired.

tools/gotestsummary reads a go test -json stream and prints one line
per finished test, the output of failed tests, the head of a package
panic (the timeout header and the running tests list), tests that never
reported a result, and the slowest tests per package.

NewTestStoreFromSQL now logs how long the sqlite seed store and the
engine under test took to come up; the summarizer attributes those to
the owning test so the per-test store cost on mysql and postgres is
visible in CI.

Two leaks made the dump unreadable and are fixed here: the sqlite seed
store was never closed once a mysql or postgres store replaced it, and
buildTestManager passed context.Background() to the metrics, caches and
controllers, so every test left its P95 flushers and cleanup loops
running until the process exited.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsVtbd7MxMVsS9vP1H6KPS
2026-09-12 09:15:20 +00:00
..