(t *testing.T)
| 1687 | ) |
| 1688 | |
| 1689 | func TestErrorCannotConnect(t *testing.T) { |
| 1690 | r := NewReader(ReaderConfig{ |
| 1691 | Brokers: []string{"localhost:9093"}, |
| 1692 | Dialer: &Dialer{Timeout: connTO}, |
| 1693 | MaxAttempts: 1, |
| 1694 | Topic: makeTopic(), |
| 1695 | }) |
| 1696 | ctx, cancel := context.WithTimeout(context.Background(), connTestTO) |
| 1697 | defer cancel() |
| 1698 | |
| 1699 | _, err := r.FetchMessage(ctx) |
| 1700 | if err == nil || ctx.Err() != nil { |
| 1701 | t.Errorf("Reader.FetchMessage must fail when it cannot " + |
| 1702 | "connect") |
| 1703 | } |
| 1704 | } |
| 1705 | |
| 1706 | func TestErrorCannotConnectGroupSubscription(t *testing.T) { |
| 1707 | r := NewReader(ReaderConfig{ |
nothing calls this directly
no test coverage detected