ipn/ipnlocal: add health.Tracker to tests where it was warning in CI

To denoise log output, to make it easier to find real failures.

Updates #19252

Change-Id: Iae64a9278c70de24a236c39e3d181a509a512a0b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
main
Brad Fitzpatrick 2 weeks ago committed by Brad Fitzpatrick
parent 85827f7503
commit 5a899e406d
  1. 3
      ipn/ipnlocal/c2n_test.go
  2. 1
      ipn/ipnlocal/local_test.go
  3. 10
      ipn/ipnlocal/network-lock_test.go
  4. 5
      ipn/ipnlocal/serve_test.go

@ -16,6 +16,7 @@ import (
"testing"
"time"
"tailscale.com/health"
"tailscale.com/ipn/store/mem"
"tailscale.com/tailcfg"
"tailscale.com/tstest"
@ -23,6 +24,7 @@ import (
"tailscale.com/types/logger"
"tailscale.com/types/netmap"
"tailscale.com/types/views"
"tailscale.com/util/eventbus/eventbustest"
"tailscale.com/util/must"
gcmp "github.com/google/go-cmp/cmp"
@ -33,6 +35,7 @@ func TestHandleC2NTLSCertStatus(t *testing.T) {
b := &LocalBackend{
store: &mem.Store{},
varRoot: t.TempDir(),
health: health.NewTracker(eventbustest.NewBus(t)),
}
certDir, err := b.certDir()
if err != nil {

@ -7763,6 +7763,7 @@ func TestStripKeysFromPrefs(t *testing.T) {
ch := make(chan *ipn.Notify, 1)
b := &LocalBackend{
extHost: h,
health: health.NewTracker(eventbustest.NewBus(t)),
notifyWatchers: map[string]*watchSession{
"test": {ch: ch},
},

@ -158,6 +158,7 @@ func TestTKAEnablementFlow(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
pm: pm,
store: pm.Store(),
}
@ -244,6 +245,7 @@ func TestTKADisablementFlow(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
authority: authority,
storage: chonk,
@ -428,6 +430,7 @@ func TestTKASync(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
pm: pm,
store: pm.Store(),
tka: &tkaState{
@ -544,6 +547,7 @@ func TestTKASyncTriggersCompact(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
pm: pm,
store: pm.Store(),
tka: &tkaState{
@ -617,6 +621,7 @@ func TestTKAFilterNetmap(t *testing.T) {
b := &LocalBackend{
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{authority: authority},
}
@ -822,6 +827,7 @@ func TestTKADisable(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
profile: pm.CurrentProfile().ID(),
authority: authority,
@ -887,6 +893,7 @@ func TestTKASign(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
authority: authority,
storage: chonk,
@ -1083,6 +1090,7 @@ func TestTKAAffectedSigs(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
authority: authority,
storage: chonk,
@ -1168,6 +1176,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) {
cc: cc,
ccAuto: cc,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
authority: authority,
storage: chonk,
@ -1187,6 +1196,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) {
b := LocalBackend{
varRoot: temp,
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
tka: &tkaState{
authority: authority,
storage: chonk,

@ -194,6 +194,7 @@ func TestGetServeHandler(t *testing.T) {
b := &LocalBackend{
serveConfig: tt.conf.View(),
logf: t.Logf,
health: health.NewTracker(eventbustest.NewBus(t)),
}
req := &http.Request{
URL: &url.URL{
@ -1191,7 +1192,9 @@ func TestServeFileOrDirectory(t *testing.T) {
}
}
b := &LocalBackend{}
b := &LocalBackend{
health: health.NewTracker(eventbustest.NewBus(t)),
}
tests := []struct {
req string

Loading…
Cancel
Save