(t *testing.T)
| 251 | } |
| 252 | |
| 253 | func TestRecvChanAsyncLeakGoRoutines(t *testing.T) { |
| 254 | s := RunDefaultServer() |
| 255 | defer s.Shutdown() |
| 256 | |
| 257 | ec := NewEConn(t) |
| 258 | defer ec.Close() |
| 259 | |
| 260 | // Call this to make sure that we have everything setup connection wise |
| 261 | ec.Flush() |
| 262 | |
| 263 | base := getStableNumGoroutine(t) |
| 264 | |
| 265 | ch := make(chan int) |
| 266 | |
| 267 | if _, err := ec.BindRecvChan("foo", ch); err != nil { |
| 268 | t.Fatalf("Failed to bind to a send channel: %v\n", err) |
| 269 | } |
| 270 | |
| 271 | // Close the receive Channel |
| 272 | close(ch) |
| 273 | |
| 274 | // The publish will trigger the close and shutdown of the Go routines |
| 275 | ec.Publish("foo", 22) |
| 276 | ec.Flush() |
| 277 | |
| 278 | checkNoGoroutineLeak(t, base, "closing channel") |
| 279 | } |
| 280 | |
| 281 | func TestRecvChanLeakGoRoutines(t *testing.T) { |
| 282 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected