mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-01 22:15:51 +00:00
ipn/e2e_test: fix flaky logout state drain
This commit is contained in:
parent
657f331e8b
commit
c10f90357e
@ -159,16 +159,21 @@ func TestIPN(t *testing.T) {
|
|||||||
n1.Backend.Logout()
|
n1.Backend.Logout()
|
||||||
|
|
||||||
t.Run("logout", func(t *testing.T) {
|
t.Run("logout", func(t *testing.T) {
|
||||||
|
var s State
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case n := <-n1.NotifyCh:
|
case n := <-n1.NotifyCh:
|
||||||
if n.State != nil {
|
if n.State == nil {
|
||||||
if *n.State != NeedsLogin {
|
continue
|
||||||
t.Errorf("n.State=%v, want %v", n.State, NeedsLogin)
|
}
|
||||||
|
s = *n.State
|
||||||
|
t.Logf("n.State=%v", s)
|
||||||
|
if s == NeedsLogin {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
case <-time.After(3 * time.Second):
|
case <-time.After(3 * time.Second):
|
||||||
t.Fatalf("timeout waiting for logout notification")
|
t.Fatalf("timeout waiting for logout State=NeedsLogin, got State=%v", s)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user