Repository navigation
Fake-engine tests no longer load the RAMSES library - #9
Merged
Merged
Conversation
The STOP-check tests built a real stepss.sim() and swapped its library for a fake, so each held a reference to the RAMSES DLL for as long as the object lived. A test that raises keeps the object alive through the exception's traceback until the garbage collector runs. On Windows the DLL is only unloaded, and its Fortran state reset, when the last reference goes, and test_ssa_engine.py relies on that reset between fixtures: on master after the merge, windows-latest with Python 3.12 found the previous test's simulation still at t = 0.5 s, while the other five legs passed, and the same leg passed in the v3.85 release gate. A late collection is the likely cause. FakeSim subclasses sim without calling its __init__ and unloads nothing, so these tests cannot hold the library at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Tests run on master after #8 was merged failed on
windows-latest/ Python 3.12 only: four tests intests/test_ssa_engine.pyfound the engine already at t = 0.0021 s or 0.5 s, where eachkundurfixture expects a fresh simulation. The other five legs passed, and the same leg passed in the v3.85 release gate a few minutes later, so it is intermittent.Likely cause
The STOP-check tests added in #8 built a real
stepss.sim()and swapped its library for a fake, so each held a reference to the RAMSES DLL while the object lived. A test that raises keeps the object alive through the exception's traceback until the garbage collector runs. On Windows the DLL is unloaded, and its Fortran state reset, only when the last reference goes, andtest_ssa_engine.pyrelies on that reset. I have not reproduced it on Windows; the intermittency and the 3.12-only leg are consistent with collection timing.Change
FakeSimsubclassessimwithout calling its__init__and its__del__unloads nothing, so these tests never load the library at all.Verified
Full suite locally on macOS, Python 3.14: 262 passed, 1 failed (
test_tar_round_trip_without_the_extraction_filter, a Python 3.14tarfileissue that fails on master too). The Windows legs of this PR's Tests run are the real check.