(t *testing.T)
| 648 | } |
| 649 | |
| 650 | func TestDispatchGetMetaChannelFull(t *testing.T) { |
| 651 | uid := types.Uid(1) |
| 652 | s := test_makeSession(uid) |
| 653 | wg := sync.WaitGroup{} |
| 654 | r := responses{} |
| 655 | wg.Add(1) |
| 656 | go s.testWriteLoop(&r, &wg) |
| 657 | |
| 658 | destUid := types.Uid(2) |
| 659 | topicName := uid.P2PName(destUid) |
| 660 | |
| 661 | // Unbuffered chan with no readers - emit will fail. |
| 662 | meta := make(chan *ClientComMessage) |
| 663 | s.subs = make(map[string]*Subscription) |
| 664 | s.subs[topicName] = &Subscription{ |
| 665 | meta: meta, |
| 666 | } |
| 667 | |
| 668 | msg := &ClientComMessage{ |
| 669 | Get: &MsgClientGet{ |
| 670 | Id: "123", |
| 671 | Topic: destUid.UserId(), |
| 672 | MsgGetQuery: MsgGetQuery{ |
| 673 | What: "desc sub", |
| 674 | }, |
| 675 | }, |
| 676 | } |
| 677 | |
| 678 | s.dispatch(msg) |
| 679 | close(s.send) |
| 680 | wg.Wait() |
| 681 | |
| 682 | verifyResponseCodes(&r, []int{http.StatusServiceUnavailable}, t) |
| 683 | } |
| 684 | |
| 685 | func TestDispatchSet(t *testing.T) { |
| 686 | uid := types.Uid(1) |
nothing calls this directly
no test coverage detected