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

Function testDeleteTopics

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

Source from the content-addressed store, hash-verified

1027}
1028
1029func testDeleteTopics(t *testing.T, conn *Conn) {
1030 topic1 := makeTopic()
1031 topic2 := makeTopic()
1032 err := conn.CreateTopics(
1033 TopicConfig{
1034 Topic: topic1,
1035 NumPartitions: 1,
1036 ReplicationFactor: 1,
1037 },
1038 TopicConfig{
1039 Topic: topic2,
1040 NumPartitions: 1,
1041 ReplicationFactor: 1,
1042 },
1043 )
1044 if err != nil {
1045 t.Fatalf("bad CreateTopics: %v", err)
1046 }
1047 conn.SetDeadline(time.Now().Add(time.Second))
1048 err = conn.DeleteTopics(topic1, topic2)
1049 if err != nil {
1050 t.Fatalf("bad DeleteTopics: %v", err)
1051 }
1052 partitions, err := conn.ReadPartitions(topic1, topic2)
1053 if err != nil {
1054 t.Fatalf("bad ReadPartitions: %v", err)
1055 }
1056 if len(partitions) != 0 {
1057 t.Fatal("exepected partitions to be empty ")
1058 }
1059}
1060
1061func testDeleteTopicsInvalidTopic(t *testing.T, conn *Conn) {
1062 topic := makeTopic()

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…