Skip to content

Commit c9758f0

Browse files
committed
Update tests with correct CommittedLeaderEpoch versioning
1 parent bbab891 commit c9758f0

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/segmentio/kafka-go
22

3-
go 1.23
3+
go 1.23.0
44

55
require (
66
github.com/klauspost/compress v1.15.9

protocol/offsetcommit/offsetcommit_test.go

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,35 @@ func TestOffsetCommitRequest(t *testing.T) {
9393
})
9494
}
9595

96-
// Version 5 added:
97-
// RequestTopic.RequestPartition.CommitedLeaderEpoc
9896
// Version 5 removed:
9997
// RetentionTimeMs
100-
// Fields are the same through version 6.
98+
for _, version := range []int16{5, 6} {
99+
prototest.TestRequest(t, version, &offsetcommit.Request{
100+
GroupID: "group-3",
101+
GenerationID: 1,
102+
MemberID: "member-3",
103+
Topics: []offsetcommit.RequestTopic{
104+
{
105+
Name: "topic-3",
106+
Partitions: []offsetcommit.RequestPartition{
107+
{
108+
PartitionIndex: 0,
109+
CommittedOffset: 1,
110+
CommittedMetadata: "meta-3-0",
111+
},
112+
{
113+
PartitionIndex: 1,
114+
CommittedOffset: 2,
115+
CommittedMetadata: "meta-3-1",
116+
},
117+
},
118+
},
119+
},
120+
})
121+
}
122+
123+
// Version 6 added:
124+
// RequestTopic.RequestPartition.CommitedLeaderEpoch
101125
for _, version := range []int16{5, 6} {
102126
prototest.TestRequest(t, version, &offsetcommit.Request{
103127
GroupID: "group-3",

0 commit comments

Comments
 (0)