ipn/ipnlocal, tstest/integration: add panic to catch flaky test in the act

Updates #11962

Change-Id: Ifa24b82f9c76639bfd83278a7c2fe9cf42897bbb
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-05-05 17:41:13 -07:00
committed by Brad Fitzpatrick
parent 258b5042fe
commit 7e0dd61e61
2 changed files with 24 additions and 3 deletions

View File

@@ -4278,6 +4278,15 @@ func (b *LocalBackend) enterStateLockedOnEntry(newState ipn.State, unlock unlock
oldState := b.state
b.state = newState
prefs := b.pm.CurrentPrefs()
// Some temporary (2024-05-05) debugging code to help us catch
// https://github.com/tailscale/tailscale/issues/11962 in the act.
if prefs.WantRunning() &&
prefs.ControlURLOrDefault() == ipn.DefaultControlURL &&
envknob.Bool("TS_PANIC_IF_HIT_MAIN_CONTROL") {
panic("[unexpected] use of main control server in integration test")
}
netMap := b.netMap
activeLogin := b.activeLogin
authURL := b.authURL