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

Function deleteTopic

reader_test.go:373–396  ·  view source on GitHub ↗
(t *testing.T, topic ...string)

Source from the content-addressed store, hash-verified

371}
372
373func deleteTopic(t *testing.T, topic ...string) {
374 t.Helper()
375 conn, err := Dial("tcp", "localhost:9092")
376 if err != nil {
377 t.Fatal(err)
378 }
379 defer conn.Close()
380
381 controller, err := conn.Controller()
382 if err != nil {
383 t.Fatal(err)
384 }
385
386 conn, err = Dial("tcp", net.JoinHostPort(controller.Host, strconv.Itoa(controller.Port)))
387 if err != nil {
388 t.Fatal(err)
389 }
390
391 conn.SetDeadline(time.Now().Add(10 * time.Second))
392
393 if err := conn.DeleteTopics(topic...); err != nil {
394 t.Fatal(err)
395 }
396}
397
398func TestReaderOnNonZeroPartition(t *testing.T) {
399 tests := []struct {

Calls 5

DialFunction · 0.85
ControllerMethod · 0.80
CloseMethod · 0.45
SetDeadlineMethod · 0.45
DeleteTopicsMethod · 0.45

Tested by

no test coverage detected