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>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
85827f7503
commit
5a899e406d
@@ -16,6 +16,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"tailscale.com/health"
|
||||||
"tailscale.com/ipn/store/mem"
|
"tailscale.com/ipn/store/mem"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
"tailscale.com/tstest"
|
"tailscale.com/tstest"
|
||||||
@@ -23,6 +24,7 @@ import (
|
|||||||
"tailscale.com/types/logger"
|
"tailscale.com/types/logger"
|
||||||
"tailscale.com/types/netmap"
|
"tailscale.com/types/netmap"
|
||||||
"tailscale.com/types/views"
|
"tailscale.com/types/views"
|
||||||
|
"tailscale.com/util/eventbus/eventbustest"
|
||||||
"tailscale.com/util/must"
|
"tailscale.com/util/must"
|
||||||
|
|
||||||
gcmp "github.com/google/go-cmp/cmp"
|
gcmp "github.com/google/go-cmp/cmp"
|
||||||
@@ -33,6 +35,7 @@ func TestHandleC2NTLSCertStatus(t *testing.T) {
|
|||||||
b := &LocalBackend{
|
b := &LocalBackend{
|
||||||
store: &mem.Store{},
|
store: &mem.Store{},
|
||||||
varRoot: t.TempDir(),
|
varRoot: t.TempDir(),
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
}
|
}
|
||||||
certDir, err := b.certDir()
|
certDir, err := b.certDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -7763,6 +7763,7 @@ func TestStripKeysFromPrefs(t *testing.T) {
|
|||||||
ch := make(chan *ipn.Notify, 1)
|
ch := make(chan *ipn.Notify, 1)
|
||||||
b := &LocalBackend{
|
b := &LocalBackend{
|
||||||
extHost: h,
|
extHost: h,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
notifyWatchers: map[string]*watchSession{
|
notifyWatchers: map[string]*watchSession{
|
||||||
"test": {ch: ch},
|
"test": {ch: ch},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ func TestTKAEnablementFlow(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
pm: pm,
|
pm: pm,
|
||||||
store: pm.Store(),
|
store: pm.Store(),
|
||||||
}
|
}
|
||||||
@@ -244,6 +245,7 @@ func TestTKADisablementFlow(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
storage: chonk,
|
storage: chonk,
|
||||||
@@ -428,6 +430,7 @@ func TestTKASync(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
pm: pm,
|
pm: pm,
|
||||||
store: pm.Store(),
|
store: pm.Store(),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
@@ -544,6 +547,7 @@ func TestTKASyncTriggersCompact(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
pm: pm,
|
pm: pm,
|
||||||
store: pm.Store(),
|
store: pm.Store(),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
@@ -616,8 +620,9 @@ func TestTKAFilterNetmap(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
b := &LocalBackend{
|
b := &LocalBackend{
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
tka: &tkaState{authority: authority},
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
|
tka: &tkaState{authority: authority},
|
||||||
}
|
}
|
||||||
|
|
||||||
n1, n2, n3, n4, n5 := key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode()
|
n1, n2, n3, n4, n5 := key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode()
|
||||||
@@ -822,6 +827,7 @@ func TestTKADisable(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
profile: pm.CurrentProfile().ID(),
|
profile: pm.CurrentProfile().ID(),
|
||||||
authority: authority,
|
authority: authority,
|
||||||
@@ -887,6 +893,7 @@ func TestTKASign(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
storage: chonk,
|
storage: chonk,
|
||||||
@@ -1083,6 +1090,7 @@ func TestTKAAffectedSigs(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
storage: chonk,
|
storage: chonk,
|
||||||
@@ -1168,6 +1176,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) {
|
|||||||
cc: cc,
|
cc: cc,
|
||||||
ccAuto: cc,
|
ccAuto: cc,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
storage: chonk,
|
storage: chonk,
|
||||||
@@ -1187,6 +1196,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) {
|
|||||||
b := LocalBackend{
|
b := LocalBackend{
|
||||||
varRoot: temp,
|
varRoot: temp,
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
tka: &tkaState{
|
tka: &tkaState{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
storage: chonk,
|
storage: chonk,
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ func TestGetServeHandler(t *testing.T) {
|
|||||||
b := &LocalBackend{
|
b := &LocalBackend{
|
||||||
serveConfig: tt.conf.View(),
|
serveConfig: tt.conf.View(),
|
||||||
logf: t.Logf,
|
logf: t.Logf,
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
}
|
}
|
||||||
req := &http.Request{
|
req := &http.Request{
|
||||||
URL: &url.URL{
|
URL: &url.URL{
|
||||||
@@ -1191,7 +1192,9 @@ func TestServeFileOrDirectory(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b := &LocalBackend{}
|
b := &LocalBackend{
|
||||||
|
health: health.NewTracker(eventbustest.NewBus(t)),
|
||||||
|
}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
req string
|
req string
|
||||||
|
|||||||
Reference in New Issue
Block a user