aiokafka
aiokafka copied to clipboard
`test_read_write_serde_v2` fails (CRC do not match)
Describe the bug
test_read_write_serde_v2 fails because CRC do not match. See: https://koji.fedoraproject.org/koji/taskinfo?taskID=124232877 -> build.log or paste below:
if crc is not None:
> assert reader.crc == crc
E assert 4072166236 == 1260758266
E + where 4072166236 = <aiokafka.record.default_records._DefaultRecordBatchPy object at 0x3ffa0ddfbb0>.crc
tests/record/test_default_records.py:68: AssertionError
=========================== short test summary info ============================
FAILED tests/record/test_default_records.py::test_read_write_serde_v2[lz4] - ...
Expected behaviour As noted in https://src.fedoraproject.org/rpms/python-aiokafka/pull-request/2#comment-222352, paraphrasing: compatibility guarantees mean compatible APIs/ABIs and compressed data streams, not bit-identical results across versions and platforms, so it is not reliable to check CRCs.
Hence, I suggest replacing CRC in:
https://github.com/aio-libs/aiokafka/blob/01c60cd9c45e975aee8d4932247108a9e639d026/tests/record/test_default_records.py#L27
with None to omit CRC comparison. I can implement this change if there is an agreement that it is the right way to solve this issue.
Environment (please complete the following information):
- aiokafka version (
python -c "import aiokafka; print(aiokafka.__version__)"): 0.11.0 - Kafka Broker version (
kafka-topics.sh --version): not applicable - Other information (Confluent Cloud version, etc.): arch
s390x,cramjam: 2.8.3
Reproducible example Run the mentioned test in the mentioned environment.