HangSubscription blocks on s.unblockHangSubscription before sending anything.
(ctx context.Context, val int)
| 90 | // HangSubscription blocks on s.unblockHangSubscription before |
| 91 | // sending anything. |
| 92 | func (s *NotificationTestService) HangSubscription(ctx context.Context, val int) (*Subscription, error) { |
| 93 | notifier, supported := NotifierFromContext(ctx) |
| 94 | if !supported { |
| 95 | return nil, ErrNotificationsUnsupported |
| 96 | } |
| 97 | |
| 98 | s.gotHangSubscriptionReq <- struct{}{} |
| 99 | <-s.unblockHangSubscription |
| 100 | subscription := notifier.CreateSubscription() |
| 101 | |
| 102 | go func() { |
| 103 | notifier.Notify(subscription.ID, val) |
| 104 | }() |
| 105 | return subscription, nil |
| 106 | } |
| 107 | |
| 108 | func TestNotifications(t *testing.T) { |
| 109 | server := NewServer() |
nothing calls this directly
no test coverage detected