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

Function testDeleteTopicsInvalidTopic

conn_test.go:1061–1085  ·  view source on GitHub ↗
(t *testing.T, conn *Conn)

Source from the content-addressed store, hash-verified

1059}
1060
1061func testDeleteTopicsInvalidTopic(t *testing.T, conn *Conn) {
1062 topic := makeTopic()
1063 err := conn.CreateTopics(
1064 TopicConfig{
1065 Topic: topic,
1066 NumPartitions: 1,
1067 ReplicationFactor: 1,
1068 },
1069 )
1070 if err != nil {
1071 t.Fatalf("bad CreateTopics: %v", err)
1072 }
1073 conn.SetDeadline(time.Now().Add(5 * time.Second))
1074 err = conn.DeleteTopics("invalid-topic", topic)
1075 if !errors.Is(err, UnknownTopicOrPartition) {
1076 t.Fatalf("expected UnknownTopicOrPartition error, but got %v", err)
1077 }
1078 partitions, err := conn.ReadPartitions(topic)
1079 if err != nil {
1080 t.Fatalf("bad ReadPartitions: %v", err)
1081 }
1082 if len(partitions) != 0 {
1083 t.Fatal("expected partitions to be empty")
1084 }
1085}
1086
1087func testController(t *testing.T, conn *Conn) {
1088 b, err := conn.Controller()

Callers

nothing calls this directly

Calls 5

makeTopicFunction · 0.70
CreateTopicsMethod · 0.45
SetDeadlineMethod · 0.45
DeleteTopicsMethod · 0.45
ReadPartitionsMethod · 0.45

Tested by

no test coverage detected