Repository navigation
test: Isolate the memory tracking tests from other buffers - #1892
Merged
polvalente merged 1 commit intoOct 22, 2026
Merged
polvalente merged 1 commit into
polvalente merged 1 commit into
Conversation
The memory statistics count every buffer of a client. ExUnit starts the next test when it gets the result of a test, before the process of that test exits. So a buffer that a test keeps can be freed during the next test, and a check of the statistics fails. For example, the donation test kept 400,000 bytes of :host buffers until its process exited. The tests now use a client that no other test uses. Each buffer that a test makes is freed in an on_exit callback, which ExUnit runs before the next test, also when an assertion fails.
georgeguimaraes
force-pushed
the
fix/memory-tracking-test-isolation
branch
from
October 21, 2026 22:06
1069721 to
4cc1432
Compare
polvalente
approved these changes
Oct 22, 2026
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.
EXLA.MemoryTrackingTestwas flaky on CI (e.g.left: 20, right: 400020). ExUnit starts the next test as soon as it gets:test_finished, before the previous test process actually exits, so buffers it still holds can get freed in the middle of the next test and mess up the stats. the 400,000 bytes aret2from the donation test.so the module now uses its own client (
:memory_tracking_host), and every buffer a test creates gets freed inon_exit, which runs before the next test even if an assertion fails.I could repro it locally by freeing a 400 KB
:hostbuffer a few ms into each test: failed on every seed before, passes now.