Bug 2290344 - python-kafka: FTBFS in Fedora Rawhide: AssertionError: assert 241 == 241.00000000000003
Summary: python-kafka: FTBFS in Fedora Rawhide: AssertionError: assert 241 == 241.0000...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: python-kafka
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Hirotaka Wakabayashi
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
: 2291753 (view as bug list)
Depends On:
Blocks: F41FTBFS F41FailsToInstall PYTHON3.13 2291813 2291822
TreeView+ depends on / blocked
 
Reported: 2024-06-04 08:55 UTC by Karolina Surma
Modified: 2024-06-18 10:58 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-06-18 10:58:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-06-04 08:55:52 UTC
Description of problem:
Package python-kafka fails to build from source in Fedora Rawhide.

Version-Release number of selected component (if applicable):
2.0.2-14.fc40

Steps to Reproduce:
koji build --scratch f41 python-kafka-2.0.2-14.fc40.src.rpm

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/python-kafka

Reproducible: Always

Actual Results:  
=================================== FAILURES ===================================
_______________________ test_memory_records_builder[1-2] _______________________
magic = 1, compression_type = 2
    @pytest.mark.parametrize("compression_type", [0, 1, 2, 3])
    @pytest.mark.parametrize("magic", [0, 1, 2])
    def test_memory_records_builder(magic, compression_type):
        builder = MemoryRecordsBuilder(
            magic=magic, compression_type=compression_type, batch_size=1024 * 10)
        base_size = builder.size_in_bytes()  # V2 has a header before
    
        msg_sizes = []
        for offset in range(10):
            metadata = builder.append(
                timestamp=10000 + offset, key=b"test", value=b"Super")
            msg_sizes.append(metadata.size)
            assert metadata.offset == offset
            if magic > 0:
                assert metadata.timestamp == 10000 + offset
            else:
                assert metadata.timestamp == -1
            assert builder.next_offset() == offset + 1
    
        # Error appends should not leave junk behind, like null bytes or something
        with pytest.raises(TypeError):
            builder.append(
                timestamp=None, key="test", value="Super")  # Not bytes, but str
    
        assert not builder.is_full()
        size_before_close = builder.size_in_bytes()
        assert size_before_close == sum(msg_sizes) + base_size
    
        # Size should remain the same after closing. No trailing bytes
        builder.close()
        assert builder.compression_rate() > 0
        expected_size = size_before_close * builder.compression_rate()
        assert builder.is_full()
>       assert builder.size_in_bytes() == expected_size
E       assert 241 == 241.00000000000003
E        +  where 241 = <bound method MemoryRecordsBuilder.size_in_bytes of <kafka.record.memory_records.MemoryRecordsBuilder object at 0x7f597eba2070>>()
E        +    where <bound method MemoryRecordsBuilder.size_in_bytes of <kafka.record.memory_records.MemoryRecordsBuilder object at 0x7f597eba2070>> = <kafka.record.memory_records.MemoryRecordsBuilder object at 0x7f597eba2070>.size_in_bytes
test/record/test_records.py:203: AssertionError
=========================== short test summary info ============================
FAILED test/record/test_records.py::test_memory_records_builder[1-2] - assert...
================= 1 failed, 1081 passed, 33 skipped in 10.95s ==================

Comment 1 Karolina Surma 2024-06-12 15:03:21 UTC
*** Bug 2291753 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2024-06-18 10:58:30 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 41.

Thanks for taking care of it!


Note You need to log in before you can comment on or make changes to this bug.