ci: add FFI memory-safety test lane#295
Open
HamdaanAliQuatil wants to merge 1 commit into
Open
Conversation
jonasfj
reviewed
Jun 29, 2026
|
|
||
| @TestOn('vm') | ||
| @Timeout(Duration(minutes: 3)) | ||
| library; |
Member
There was a problem hiding this comment.
May I suggest we re-organize this a bit.
test/
ffi/
valgrind_test.dart // void main() => test( => process.runSync(valgrind...
valgrind_target.dart // void main() {...
So that valgrind_test.dart is annotated @TestOn('vm') and it has:
if(!linux) { markTestSkipped('only test on linux'); return; }
Probably, we could even run Process.runSync(which valgrind and skip the test if valgrind is not installed.
valgrind_target.dart is just a main with print("#symmetric operations survive memory pressure") doesn't use package:test, it can still throw AssertionError or use package:checks to make assertions. But it's really not about testing logic, it's about calling methods and doing memory pressure things and letting valgrind have some behavior that it can inspect.
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.
Closes #278
This adds a focused VM-only memory-safety test for the native FFI path and runs it under Valgrind on Linux CI.
What this covers:
The new CI job uses dart test, not dart test -c exe, because the normal dart test path supports native build hooks today. Sanitizer support for hook-built code is still blocked upstream, so this starts with Valgrind memcheck instead.
Valgrind is configured to show definite and possible leaks, but only fail on definite leaks. Possible leaks can include runtime noise from the Dart VM, so this keeps the first lane useful without making it too brittle.