[
https://issues.apache.org/jira/browse/AVRO-4230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058749#comment-18058749
]
Todd McDowell commented on AVRO-4230:
-------------------------------------
Can anyone help me here? I'm new to the GitHub contribution world. I see some
of the checks were not successful. The errors seemed to be related to setting
up Perl as opposed to my code changes. I'm not sure what went wrong, nor how
to proceed from here. The tests passed with prove in my Codespace before I
submitted the pull request. Help?!?
> Avro::BinaryEncoder's encode_map generates non-deterministic output which
> makes writing unit tests more difficult
> -----------------------------------------------------------------------------------------------------------------
>
> Key: AVRO-4230
> URL: https://issues.apache.org/jira/browse/AVRO-4230
> Project: Apache Avro
> Issue Type: Improvement
> Components: perl
> Affects Versions: 1.12.1
> Reporter: Todd McDowell
> Priority: Minor
> Labels: pull-request-available
> Original Estimate: 2h
> Time Spent: 20m
> Remaining Estimate: 1h 40m
>
> I was attempting to write unit tests for Perl code that was making use of
> Avro::BinaryEncoder. The code was specifically calling encode_map, which
> encodes a Perl hash into binary. However, since Perl's keys function does
> not guarantee a consistent order of the hash's keys, the expected value from
> encode_map occasionally fails to match the observed value, which causes the
> test to fail.
> I recommend sorting the keys of the data in encode_map before the encoding
> process to ensure a deterministic output from encode_map. I've already
> modified the code, but I needed to submit this issue before I could submit
> the pull request change based on the instructions I read. The deterministic
> output from encode_map will make testing simpler. I'll submit that change
> for review shortly.
> Thanks for your attention.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)