|
|
|
@ -159,16 +159,21 @@ drain:
|
|
|
|
n1.Backend.Logout()
|
|
|
|
n1.Backend.Logout()
|
|
|
|
|
|
|
|
|
|
|
|
t.Run("logout", func(t *testing.T) {
|
|
|
|
t.Run("logout", func(t *testing.T) {
|
|
|
|
select {
|
|
|
|
var s State
|
|
|
|
case n := <-n1.NotifyCh:
|
|
|
|
for {
|
|
|
|
if n.State != nil {
|
|
|
|
select {
|
|
|
|
if *n.State != NeedsLogin {
|
|
|
|
case n := <-n1.NotifyCh:
|
|
|
|
t.Errorf("n.State=%v, want %v", n.State, NeedsLogin)
|
|
|
|
if n.State == nil {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
s = *n.State
|
|
|
|
|
|
|
|
t.Logf("n.State=%v", s)
|
|
|
|
|
|
|
|
if s == NeedsLogin {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case <-time.After(3 * time.Second):
|
|
|
|
|
|
|
|
t.Fatalf("timeout waiting for logout State=NeedsLogin, got State=%v", s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case <-time.After(3 * time.Second):
|
|
|
|
|
|
|
|
t.Fatalf("timeout waiting for logout notification")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|