test: NoticeHandler malformed ignored

This commit is contained in:
Jay
2026-06-03 15:18:10 -04:00
parent ee0f5953da
commit 9d4873f8d4
+14 -3
View File
@@ -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) {