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

Function testWriteFetchRequestV2

write_test.go:55–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func testWriteFetchRequestV2(t *testing.T) {
56 const offset = 42
57 const minBytes = 10
58 const maxBytes = 1000
59 const maxWait = 100 * time.Millisecond
60 testWriteOptimization(t,
61 requestHeader{
62 ApiKey: int16(fetch),
63 ApiVersion: int16(v2),
64 CorrelationID: testCorrelationID,
65 ClientID: testClientID,
66 },
67 fetchRequestV2{
68 ReplicaID: -1,
69 MaxWaitTime: milliseconds(maxWait),
70 MinBytes: minBytes,
71 Topics: []fetchRequestTopicV2{{
72 TopicName: testTopic,
73 Partitions: []fetchRequestPartitionV2{{
74 Partition: testPartition,
75 FetchOffset: offset,
76 MaxBytes: maxBytes,
77 }},
78 }},
79 },
80 func(w *writeBuffer) {
81 w.writeFetchRequestV2(testCorrelationID, testClientID, testTopic, testPartition, offset, minBytes, maxBytes, maxWait)
82 },
83 )
84}
85
86func testWriteListOffsetRequestV1(t *testing.T) {
87 const time = -1

Callers

nothing calls this directly

Calls 3

testWriteOptimizationFunction · 0.85
millisecondsFunction · 0.85
writeFetchRequestV2Method · 0.80

Tested by

no test coverage detected