S01 follow-up: remove TestMain sink workaround once LabKit v2.8.0 signal-handler fix lands

Context

MR !291, note 3382835815 documents a LabKit v2.8.0 race in app.Run: signal.Notify is called only after a.Start returns (app.go#L469-L484). A SIGTERM in that window has no Go handler and the OS kills the binary.

AR works around this in cmd/artifact-registry/main_test.go with:

  1. A TestMain sink (cap=1 channel registered with signal.Notify) that keeps a Go handler in place so the OS does not kill the test process.
  2. A keepSignalling helper that re-fires the signal every 100ms. Go's signal package fans each signal to every registered channel independently, so the retry lands on LabKit's channel as soon as app.Run installs it.

We should ask the LabKit team in the MR thread to consider moving signal.Notify inside a.Start so the handler is in place before Start returns. Upstream tracker TBD.

When to revisit

Once LabKit ships a fix:

  1. Drop the TestMain sink installation in cmd/artifact-registry/main_test.go.
  2. Replace keepSignalling(t, syscall.SIGTERM) call sites with a direct syscall.Kill(os.Getpid(), syscall.SIGTERM).
  3. Remove the keepSignalling helper.
  4. Trim the workaround narrative from the test file's package doc and related comments.
Edited by João Pereira