(t *testing.T)
| 297 | } |
| 298 | |
| 299 | func TestDispatchSubscribeJoinChannelFull(t *testing.T) { |
| 300 | uid := types.Uid(1) |
| 301 | s := test_makeSession(uid) |
| 302 | wg := sync.WaitGroup{} |
| 303 | r := responses{} |
| 304 | wg.Add(1) |
| 305 | go s.testWriteLoop(&r, &wg) |
| 306 | |
| 307 | hub := &Hub{ |
| 308 | // Make it unbuffered with no readers - so emit operation fails immediately. |
| 309 | join: make(chan *ClientComMessage), |
| 310 | } |
| 311 | globals.hub = hub |
| 312 | |
| 313 | defer func() { |
| 314 | globals.hub = nil |
| 315 | }() |
| 316 | |
| 317 | msg := &ClientComMessage{ |
| 318 | Sub: &MsgClientSub{ |
| 319 | Id: "123", |
| 320 | Topic: "me", |
| 321 | Get: &MsgGetQuery{ |
| 322 | What: "sub desc tags cred", |
| 323 | }, |
| 324 | }, |
| 325 | } |
| 326 | |
| 327 | s.dispatch(msg) |
| 328 | close(s.send) |
| 329 | wg.Wait() |
| 330 | |
| 331 | verifyResponseCodes(&r, []int{http.StatusServiceUnavailable}, t) |
| 332 | } |
| 333 | |
| 334 | func TestDispatchLeave(t *testing.T) { |
| 335 | uid := types.Uid(1) |
nothing calls this directly
no test coverage detected
searching dependent graphs…