test: NoticeHandler malformed ignored
This commit is contained in:
+14
-3
@@ -31,9 +31,20 @@ func TestNoticeHandler(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("malformed ignored", func(t *testing.T) {
|
t.Run("malformed ignored", func(t *testing.T) {
|
||||||
// p.receive([]byte("not json"))
|
p, envoy := newMockEnvoy(t)
|
||||||
// Never: nothing readable from h.Notices() within NegativeTestTimeout
|
h := NewNoticeHandler(envoy)
|
||||||
// assert no panic
|
t.Cleanup(h.Close)
|
||||||
|
|
||||||
|
p.receive([]byte("not json"))
|
||||||
|
|
||||||
|
Never(t, func() bool {
|
||||||
|
select {
|
||||||
|
case <-h.Notices():
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}, "notices channel should remain empty")
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("observer notified", func(t *testing.T) {
|
t.Run("observer notified", func(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user