-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Since the Rust toolchain was updated to 1.84 in Fedora, the python-cramjam package has been failing to build from source due to test failures in test_variants_decompress_into. It’s consistent that some parameterizations of this test fail, but the particular ones that fail vary from run to run. The problem still occurs if I update to a snapshot of 61564e7 and ensure experimental codecs are disabled.
For example:
=================================== FAILURES ===================================
___________ test_variants_decompress_into[snappy-Buffer-memoryview] ____________
+ Exception Group Traceback (most recent call last):
| File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 341, in from_call
| result: TResult | None = func()
| ~~~~^^
[… many lines omitted for brevity … ]
| hypothesis.errors.FlakyFailure: Hypothesis test_variants_decompress_into(variant_str='snappy', input_type=memoryview, output_type=Buffer, tmp_path_factory=TempPathFactory(_given_basetemp=None,
| _trace=<pluggy._tracing.TagTracerSub object at 0x7f0cbaabed70>,
| _basetemp=PosixPath('/tmp/pytest-of-mockbuild/pytest-0'),
| _retention_count=3,
| _retention_policy='all'), raw_data=b'\xd0', is_pypy=False) produces unreliable results: Falsified on the first call but did not on a subsequent one (1 sub-exception)
| Falsifying example: test_variants_decompress_into(
| variant_str='snappy',
| input_type=memoryview,
| output_type=Buffer,
| tmp_path_factory=TempPathFactory(_given_basetemp=None,
| _trace=<pluggy._tracing.TagTracerSub object at 0x7f0cbaabed70>,
| _basetemp=PosixPath('/tmp/pytest-of-mockbuild/pytest-0'),
| _retention_count=3,
| _retention_policy='all'),
| is_pypy=False,
| raw_data=b'\xd0',
| )
| Failed to reproduce exception. Expected:
| variant_str = 'snappy', input_type = <class 'memoryview'>
| output_type = <class 'builtins.Buffer'>
| tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7f0cbaabed70>, _basetemp=PosixPath('/tmp/pytest-of-mockbuild/pytest-0'), _retention_count=3, _retention_policy='all')
| raw_data = b'0', is_pypy = False
[… many lines omitted for brevity … ]
| > assert same_same(output, raw_data)
| E AssertionError: assert False
| E + where False = same_same(b'\xd0', b'0')
|
| tests/test_variants.py:231: AssertionError
|
+-+---------------- 1 ----------------
| AssertionError: assert False
| + where False = same_same(b'\xd0', b'0')
+------------------------------------
[… many lines omitted for brevity … ]
=========================== short test summary info ============================
FAILED tests/test_variants.py::test_variants_decompress_into[snappy-Buffer-memoryview]
FAILED tests/test_variants.py::test_variants_decompress_into[lz4-Buffer-Buffer]
FAILED tests/test_variants.py::test_variants_decompress_into[zlib-File-memoryview]
================== 3 failed, 719 passed, 1 skipped in 19.04s ===================
I refrained from immediately filing an issue upstream because I couldn’t reproduce the problem in a git checkout, but something changed at some point, and now I can reproduce it, or at least something similar. Working on Fedora 41:
$ git clone https://github.com/milesgranger/cramjam.git
$ cd cramjam
$ uv venv _e
$ . _e/bin/activate
(_e) $ uv pip install -e .[dev]
(_e) $ python -m pytest --ignore=benchmarks/test_bench.py -n auto
[…]
INTERNALERROR> self, node: WorkerController, formatted_error: str
INTERNALERROR> ) -> None:
INTERNALERROR> """
INTERNALERROR> pytest_internalerror() was called on the worker.
INTERNALERROR>
INTERNALERROR> pytest_internalerror() arguments are an excinfo and an excrepr, which can't
INTERNALERROR> be serialized, so we go with a poor man's solution of raising an exception
INTERNALERROR> here ourselves using the formatted message.
INTERNALERROR> """
INTERNALERROR> self._active_nodes.remove(node)
INTERNALERROR> try:
INTERNALERROR> > assert False, formatted_error
INTERNALERROR> E AssertionError: Traceback (most recent call last):
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/main.py", line 283, in wrap_session
INTERNALERROR> E session.exitstatus = doit(config, session) or 0
INTERNALERROR> E ~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/main.py", line 337, in _main
INTERNALERROR> E config.hook.pytest_runtestloop(session=session)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR> E return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> E return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR> E raise exception.with_traceback(exception.__traceback__)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/logging.py", line 803, in pytest_runtestloop
INTERNALERROR> E return (yield) # Run all the tests.
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/terminal.py", line 673, in pytest_runtestloop
INTERNALERROR> E result = yield
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> E res = hook_impl.function(*args)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/xdist/remote.py", line 174, in pytest_runtestloop
INTERNALERROR> E self.run_one_test()
INTERNALERROR> E ~~~~~~~~~~~~~~~~~^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/xdist/remote.py", line 195, in run_one_test
INTERNALERROR> E self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR> E return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> E return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR> E raise exception.with_traceback(exception.__traceback__)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/warnings.py", line 112, in pytest_runtest_protocol
INTERNALERROR> E return (yield)
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/assertion/__init__.py", line 176, in pytest_runtest_protocol
INTERNALERROR> E return (yield)
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/unittest.py", line 429, in pytest_runtest_protocol
INTERNALERROR> E res = yield
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> E teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/faulthandler.py", line 88, in pytest_runtest_protocol
INTERNALERROR> E return (yield)
INTERNALERROR> E ^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> E res = hook_impl.function(*args)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/runner.py", line 113, in pytest_runtest_protocol
INTERNALERROR> E runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> E ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/runner.py", line 137, in runtestprotocol
INTERNALERROR> E reports.append(call_and_report(item, "teardown", log, nextitem=nextitem))
INTERNALERROR> E ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/runner.py", line 244, in call_and_report
INTERNALERROR> E report: TestReport = ihook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR> E return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> E return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 156, in _multicall
INTERNALERROR> E teardown[0].send(outcome)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_hypothesis_pytestplugin.py", line 368, in pytest_runtest_makereport
INTERNALERROR> E from hypothesis.extra._patching import FAIL_MSG, get_patch_for
INTERNALERROR> E File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
INTERNALERROR> E File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
INTERNALERROR> E File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/assertion/rewrite.py", line 175, in exec_module
INTERNALERROR> E source_stat, co = _rewrite_test(fn, self.config)
INTERNALERROR> E ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/assertion/rewrite.py", line 355, in _rewrite_test
INTERNALERROR> E tree = ast.parse(source, filename=strfn)
INTERNALERROR> E File "/usr/lib64/python3.13/ast.py", line 54, in parse
INTERNALERROR> E return compile(source, filename, mode, flags,
INTERNALERROR> E _feature_version=feature_version, optimize=optimize)
INTERNALERROR> E File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/hypothesis/extra/_patching.py", line 167
INTERNALERROR> E the_call = node.body[0].body[0].value
INTERNALERROR> E SyntaxError: could not convert string to float: '�' - Consider hexadecimal for huge integer literals to avoid decimal conversion limits.
INTERNALERROR> E assert False
INTERNALERROR>
INTERNALERROR> _e/lib64/python3.13/site-packages/xdist/dsession.py:232: AssertionError
..INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/main.py", line 283, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> ~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/main.py", line 337, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR> raise exception.with_traceback(exception.__traceback__)
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/logging.py", line 803, in pytest_runtestloop
INTERNALERROR> return (yield) # Run all the tests.
INTERNALERROR> ^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr]
INTERNALERROR> ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/_pytest/terminal.py", line 673, in pytest_runtestloop
INTERNALERROR> result = yield
INTERNALERROR> ^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/xdist/dsession.py", line 138, in pytest_runtestloop
INTERNALERROR> self.loop_once()
INTERNALERROR> ~~~~~~~~~~~~~~^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/xdist/dsession.py", line 163, in loop_once
INTERNALERROR> call(**kwargs)
INTERNALERROR> ~~~~^^^^^^^^^^
INTERNALERROR> File "/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/xdist/dsession.py", line 217, in worker_workerfinished
INTERNALERROR> assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('tests/test_variants.py::test_variants_decompress_into[zstd-Buffer-bytearray]', <WorkerController gw13>)
INTERNALERROR> assert not 'tests/test_variants.py::test_variants_decompress_into[zstd-Buffer-bytearray]'
============================================================================= 1 failed, 595 passed, 1 skipped, 1 warning in 5.36s =============================================================================
Ok, that’s not exactly the same, but it looks like it could be the same root cause presenting differently due to slightly different versions of pytest, hypothesis, etc.
Repeating the same command shows the failure is flaky:
$ python -m pytest --ignore=benchmarks/test_bench.py -n auto
/home/ben/src/forks/cramjam/_e/lib64/python3.13/site-packages/pytest_benchmark/logger.py:39: PytestBenchmarkWarning: Benchmarks are automatically disabled because xdist plugin is active.Benchmarks cannot be performed reliably in a parallelized environment.
warner(PytestBenchmarkWarning(text))
============================================================================================= test session starts =============================================================================================
platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
benchmark: 5.1.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/ben/src/forks/cramjam
configfile: pyproject.toml
plugins: hypothesis-6.124.9, xdist-3.6.1, benchmark-5.1.0
16 workers [722 items] ipped
....................................................................................................................................................................................................... [ 27%]
....................................................................................................................................................................................................... [ 55%]
....................................................................................................................................................................................................... [ 82%]
............................................................................................................................. [100%]
======================================================================================= 722 passed, 1 skipped in 3.36s ========================================================================================
It seems I got “lucky” catching this in the virtualenv, because I didn’t see any more failures in 10-20 subsequent attempts. I don’t know why the problem is so much easier to reproduce in the Fedora packages – compiler flags? dependency versions? rustc patches? release vs. debug builds?
I’m happy to do any experiments or provide any data that would help.
I’m at my wits’ end with these test failures. I am concerned that they may reflect possible flaky/racy data corruption in python-cramjam package in Fedora, but I have no idea how to find the root cause. If I can’t find a way to resolve the test failures, I’m reluctantly considering orphaning python-cramjam and related packages sometime well before the Fedora 42 final freeze, which would probably lead to these packages being retired from the distribution.