(t *testing.T)
| 1704 | } |
| 1705 | |
| 1706 | func TestErrorCannotConnectGroupSubscription(t *testing.T) { |
| 1707 | r := NewReader(ReaderConfig{ |
| 1708 | Brokers: []string{"localhost:9093"}, |
| 1709 | Dialer: &Dialer{Timeout: 1 * time.Second}, |
| 1710 | GroupID: "foobar", |
| 1711 | MaxAttempts: 1, |
| 1712 | Topic: makeTopic(), |
| 1713 | }) |
| 1714 | ctx, cancel := context.WithTimeout(context.Background(), connTestTO) |
| 1715 | defer cancel() |
| 1716 | |
| 1717 | _, err := r.FetchMessage(ctx) |
| 1718 | if err == nil || ctx.Err() != nil { |
| 1719 | t.Errorf("Reader.FetchMessage with a group subscription " + |
| 1720 | "must fail when it cannot connect") |
| 1721 | } |
| 1722 | } |
| 1723 | |
| 1724 | // Tests that the reader can handle messages where the response is truncated |
| 1725 | // due to reaching MaxBytes. |
nothing calls this directly
no test coverage detected