MCPcopy
hub / github.com/nats-io/nats.go / TestRecvChanPanicOnClosedChan

Function TestRecvChanPanicOnClosedChan

test/netchan_test.go:235–251  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestRecvChanPanicOnClosedChan(t *testing.T) {
236 s := RunDefaultServer()
237 defer s.Shutdown()
238
239 ec := NewEConn(t)
240 defer ec.Close()
241
242 ch := make(chan int)
243
244 if _, err := ec.BindRecvChan("foo", ch); err != nil {
245 t.Fatalf("Failed to bind to a send channel: %v\n", err)
246 }
247
248 close(ch)
249 ec.Publish("foo", 22)
250 ec.Flush()
251}
252
253func TestRecvChanAsyncLeakGoRoutines(t *testing.T) {
254 s := RunDefaultServer()

Callers

nothing calls this directly

Calls 7

NewEConnFunction · 0.85
BindRecvChanMethod · 0.80
FatalfMethod · 0.80
RunDefaultServerFunction · 0.70
PublishMethod · 0.65
CloseMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected