[ 
https://issues.apache.org/jira/browse/KAFKA-21121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai resolved KAFKA-21121.
------------------------------------
    Fix Version/s: 4.5.0
       Resolution: Fixed

> shouldBeEqualsIfOnlyDifferInCommittedOffsets and 
> shouldBeEqualsIfOnlyDifferInEndOffsets don't test what they want
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-21121
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21121
>             Project: Kafka
>          Issue Type: Test
>            Reporter: Chia-Ping Tsai
>            Assignee: Hung-Yau Su
>            Priority: Trivial
>             Fix For: 4.5.0
>
>
> {code:java}
>     public static final Map<TopicPartition, Long> COMMITTED_OFFSETS = 
> mkMap(mkEntry(TP_1, 1L), mkEntry(TP_1, 2L));
>     public static final Map<TopicPartition, Long> END_OFFSETS = 
> mkMap(mkEntry(TP_1, 1L), mkEntry(TP_1, 3L)); {code}
> COMMITTED_OFFSETS and END_OFFSETS should have two items, but they use 
> {{TP_1}} for both keys. shouldBeEqualsIfOnlyDifferInCommittedOffsets and 
> shouldBeEqualsIfOnlyDifferInEndOffsets have the same typo. As a result, the 
> committed offsets in shouldBeEqualsIfOnlyDifferInCommittedOffsets end up 
> identical to COMMITTED_OFFSETS, which violates the test scenario. 
> shouldBeEqualsIfOnlyDifferInEndOffsets still passes with different values, 
> but only by luck.
> BTW, we should leverage Map.of to avoid similar typo in the future 😊



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to