Package: src:python-memray
Version: 1.20.0+dfsg-1
Severity: serious
Tags: sid forky

seen in the autopkg tests triggered by elfutils, this seems to be an overly strict version check:

[...]
224s =================================== FAILURES =================================== 224s ___________________________ test_write_basic_records ___________________________
224s
224s tmp_path = PosixPath('/tmp/pytest-of-test/pytest-1/test_write_basic_records0')
224s
224s     def test_write_basic_records(tmp_path):
224s         """Test writing basic records to a file."""
224s         # GIVEN
224s         output_file = tmp_path / "test.memray"
224s
224s         # WHEN
224s         writer = RecordWriterTestHarness(
224s             str(output_file),
224s             native_traces=True,
224s             trace_python_allocators=True,
224s             file_format=FileFormat.ALL_ALLOCATIONS,
224s             main_tid=10,
224s             skipped_frames=15,
224s             libdest='/some/path with spaces and a ":" too',
224s             site_packages=["/some/path", '/"another"/path too'],
224s             sys_path=["/some/path", '/"another"/path too'],
224s         )
224s
224s         assert writer.write_memory_record(1757101101880, 1024)
224s         assert writer.write_memory_record(1757101102880, 2048)
224s
224s         assert writer.write_thread_record(1, "MainThread")
224s         assert writer.write_thread_record(2, "Other Thread")
224s
224s         assert writer.write_code_object(1, "a", "a.py", b"", 1)
224s         assert writer.write_code_object(2, "b", "b.py", b"", 11)
224s         assert writer.write_code_object(3, "c", "c.py", b"", 21)
224s
224s         assert writer.write_frame_push(1, 1, 12, True)
224s         assert writer.write_frame_push(1, 2, 34, True)
224s         assert writer.write_frame_push(1, 3, 56, True)
224s
224s         assert writer.write_frame_pop(1, 0)
224s         assert writer.write_frame_pop(1, 1)
224s         assert writer.write_frame_pop(1, 16)
224s         assert writer.write_frame_pop(1, 17)
224s
224s         assert writer.write_unresolved_native_frame(0xDEADBEEF, 1)
224s         assert writer.write_unresolved_native_frame(0xFEEDCAFE, 2)
224s
224s assert writer.write_allocation_record(1, 0x1000, 1024, AllocatorType.MALLOC, 1) 224s assert writer.write_allocation_record(1, 0x2000, 2048, AllocatorType.PYMALLOC_FREE) 224s assert writer.write_allocation_record(1, 0x3000, 4096, AllocatorType.POSIX_MEMALIGN)
224s
224s assert writer.write_allocation_record(2, 0x4000, 4096, AllocatorType.MALLOC, 2)
224s
224s         assert writer.write_mappings(
224s             [
224s                 {
224s                     "filename": "/usr/lib/libc.so.6",
224s                     "addr": 0xF1234567,
224s                     "segments": [
224s                         {"vaddr": 0x12345678, "memsz": 0x1000},
224s                         {"vaddr": 0xF2345678, "memsz": 0x2000},
224s                     ],
224s                 }
224s             ]
224s         )
224s
224s         assert writer.write_trailer()
224s
224s         # THEN
224s         header_fields, records = parse_capture_file(output_file)
224s         allocator = (
224s "mimalloc" if sysconfig.get_config_var("Py_GIL_DISABLED") else "pymalloc"
224s         )
224s
224s >       assert header_fields == [
224s             ("magic", "memray"),
224s             ("version", "13"),
224s             ("python_version", f"{sys.hexversion:08x}"),
224s             ("native_traces", "true"),
224s             ("file_format", "ALL_ALLOCATIONS"),
224s             ("n_allocations", "0"),
224s             ("n_frames", "0"),
224s             ("start_time", ANY),
224s             ("end_time", ANY),
224s             ("pid", f"{os.getpid()}"),
224s             ("main_tid", "10"),
224s             ("skipped_frames_on_main_tid", "15"),
224s             ("command_line", "memray test harness"),
224s             ("python_allocator", allocator),
224s             ("trace_python_allocators", "true"),
224s             ("track_object_lifetimes", "false"),
224s             ("libdest", '/some/path with spaces and a ":" too'),
224s             ("site_packages", '[/some/path, /"another"/path too]'),
224s             ("sys.path", '[/some/path, /"another"/path too]'),
224s         ]
224s E AssertionError: assert [('magic', 'm...s', '0'), ...] == [('magic', 'm...s', '0'), ...]
224s E
224s E At index 2 diff: ('python_version', '030e07f0') != ('python_version', '030e06f0')
224s E
224s E         Full diff:
224s E           [
224s E               (
224s E                   'magic',...
224s E
224s E         ...Full output truncated (80 lines hidden), use '-vv' to show
224s
224s tests/integration/test_record_writer.py:146: AssertionError
224s ________________________ test_write_aggregated_records _________________________
224s
224s tmp_path = PosixPath('/tmp/pytest-of-test/pytest-1/test_write_aggregated_records0')
224s
224s     def test_write_aggregated_records(tmp_path):
224s         """Test writing aggregated records to a file."""
224s         # GIVEN
224s         output_file = tmp_path / "test_aggregated.memray"
224s
224s         # WHEN
224s         writer = RecordWriterTestHarness(
224s             str(output_file),
224s             native_traces=False,
224s             trace_python_allocators=False,
224s             file_format=FileFormat.AGGREGATED_ALLOCATIONS,
224s         )
224s
224s         assert writer.write_memory_record(1757105244685, 10000)
224s
224s         assert writer.write_code_object(10, "a", "a.py", b"", 1)
224s         assert writer.write_code_object(20, "b", "b.py", b"", 11)
224s         assert writer.write_code_object(30, "c", "c.py", b"", 21)
224s
224s         assert writer.write_frame_push(1, 1, 12, True)
224s         assert writer.write_frame_push(1, 2, 34, True)
224s assert writer.write_allocation_record(1, 0x1000, 1024, AllocatorType.MALLOC)
224s
224s         assert writer.write_frame_push(2, 3, 56, True)
224s assert writer.write_allocation_record(2, 0x2000, 2048, AllocatorType.MALLOC)
224s
224s         assert writer.write_memory_record(1757105245685, 20000)
224s
224s         assert writer.write_trailer()
224s
224s         # THEN
224s         header_fields, records = parse_capture_file(output_file)
224s         allocator = (
224s "mimalloc" if sysconfig.get_config_var("Py_GIL_DISABLED") else "pymalloc"
224s         )
224s
224s >       assert header_fields == [
224s             ("magic", "memray"),
224s             ("version", "13"),
224s             ("python_version", f"{sys.hexversion:08x}"),
224s             ("native_traces", "false"),
224s             ("file_format", "AGGREGATED_ALLOCATIONS"),
224s             ("n_allocations", "0"),
224s             ("n_frames", "0"),
224s             ("start_time", ANY),
224s             ("end_time", ANY),
224s             ("pid", f"{os.getpid()}"),
224s             ("main_tid", "1"),
224s             ("skipped_frames_on_main_tid", "0"),
224s             ("command_line", "memray test harness"),
224s             ("python_allocator", allocator),
224s             ("trace_python_allocators", "false"),
224s             ("track_object_lifetimes", "false"),
224s             ("libdest", ""),
224s             ("site_packages", "[]"),
224s             ("sys.path", "[]"),
224s         ]
224s E AssertionError: assert [('magic', 'm...s', '0'), ...] == [('magic', 'm...s', '0'), ...]
224s E
224s E At index 2 diff: ('python_version', '030e07f0') != ('python_version', '030e06f0')
224s E
224s E         Full diff:
224s E           [
224s E               (
224s E                   'magic',...
224s E
224s E         ...Full output truncated (80 lines hidden), use '-vv' to show
224s
224s tests/integration/test_record_writer.py:267: AssertionError
224s =============================== warnings summary ===============================
224s tests/conftest.py:60
224s /tmp/autopkgtest.WCj8Ou/autopkgtest_tmp/tests/conftest.py:60: UserWarning: snapshot tests require pytest-textual-snapshot but it is not installed
224s     config.issue_config_time_warning(UserWarning(reason), stacklevel=2)
224s
224s tests/integration/test_processes.py: 57 warnings
224s /usr/lib/python3.14/multiprocessing/popen_fork.py:76: DeprecationWarning: This process (pid=5799) is multi-threaded, use of fork() may lead to deadlocks in the child.
224s     self.pid = os.fork()
224s
224s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
224s =========================== short test summary info ============================ 224s FAILED tests/integration/test_record_writer.py::test_write_basic_records - As... 224s FAILED tests/integration/test_record_writer.py::test_write_aggregated_records 224s = 2 failed, 567 passed, 31 skipped, 14 deselected, 58 warnings in 61.93s (0:01:01) =

Reply via email to