MCPcopy
hub / github.com/segmentio/kafka-go / testWriterMaxAttemptsErr

Function testWriterMaxAttemptsErr

writer_test.go:330–349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

328}
329
330func testWriterMaxAttemptsErr(t *testing.T) {
331 topic := makeTopic()
332 createTopic(t, topic, 1)
333 defer deleteTopic(t, topic)
334
335 w := newTestWriter(WriterConfig{
336 Brokers: []string{"localhost:9999"}, // nothing is listening here
337 Topic: topic,
338 MaxAttempts: 3,
339 Balancer: &RoundRobin{},
340 })
341 defer w.Close()
342
343 if err := w.WriteMessages(context.Background(), Message{
344 Value: []byte("Hello World!"),
345 }); err == nil {
346 t.Error("expected error")
347 return
348 }
349}
350
351func testWriterMaxBytes(t *testing.T) {
352 topic := makeTopic()

Callers

nothing calls this directly

Calls 7

createTopicFunction · 0.85
deleteTopicFunction · 0.85
newTestWriterFunction · 0.85
makeTopicFunction · 0.70
CloseMethod · 0.45
WriteMessagesMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected