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

Function TestConn

conn_test.go:114–362  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestConn(t *testing.T) {
115 tests := []struct {
116 scenario string
117 function func(*testing.T, *Conn)
118 minVersion string
119 }{
120 {
121 scenario: "close right away",
122 function: testConnClose,
123 },
124
125 {
126 scenario: "ensure the initial offset of a connection is the first offset",
127 function: testConnFirstOffset,
128 },
129
130 {
131 scenario: "write a single message to kafka should succeed",
132 function: testConnWrite,
133 },
134
135 {
136 scenario: "writing a message to a closed kafka connection should fail",
137 function: testConnCloseAndWrite,
138 },
139
140 {
141 scenario: "ensure the connection can seek to the first offset",
142 function: testConnSeekFirstOffset,
143 },
144
145 {
146 scenario: "ensure the connection can seek to the last offset",
147 function: testConnSeekLastOffset,
148 },
149
150 {
151 scenario: "ensure the connection can seek relative to the current offset",
152 function: testConnSeekCurrentOffset,
153 },
154
155 {
156 scenario: "ensure the connection can seek to a random offset",
157 function: testConnSeekRandomOffset,
158 },
159
160 {
161 scenario: "unchecked seeks allow the connection to be positioned outside the boundaries of the partition",
162 function: testConnSeekDontCheck,
163 },
164
165 {
166 scenario: "writing and reading messages sequentially should preserve the order",
167 function: testConnWriteReadSequentially,
168 },
169
170 {
171 scenario: "writing a batch of messages and reading it sequentially should preserve the order",

Callers

nothing calls this directly

Calls 4

DialLeaderMethod · 0.95
CloseMethod · 0.95
makeTopicFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected