Skip to content

[jnigen] Fix race conditions in tests - #3767

Merged
goderbauer merged 4 commits into
dart-lang:mainfrom
goderbauer:jnigen-fix-test-races
Oct 30, 2026
Merged

goderbauer merged 4 commits into
dart-lang:mainfrom
goderbauer:jnigen-fix-test-races

Conversation

@goderbauer

@goderbauer goderbauer commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Antigravity fixed two test race conditions in package:jnigen that frequently occurred on CI for dart-lang/native#3766, dart-lang/native#3765, and dart-lang/native#3756:

  • Isolate mvn package and javac output directories across bindingsTestSetup, descriptor_test, kotlin_test, and simple_package_test so concurrent test suites do not overwrite kotlin_test-jar-with-dependencies.jar or .class files while other tests are reading them, and evaluate getConfig lazily inside generateAndCompare so -x bindings test runs do not trigger unnecessary builds during test registration.
  • Release arg before sending 'callback_executed' and defer callbackPort.send('callback_executed') via Timer.run in _jnigenConsumerIsolateEntry so both arg?.release() and the generated binding's $i.args?.release() (which runs after _$invokeMethod returns) complete before the main isolate kills the consumer isolate with Isolate.immediate.

@github-actions github-actions Bot added type-infra A repository infrastructure change or enhancement package:jnigen labels Oct 27, 2026
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.94%. Comparing base (eb09430) to head (452d90c).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3767   +/-   ##
=======================================
  Coverage   87.94%   87.94%           
=======================================
  Files         310      310           
  Lines       19848    19848           
=======================================
  Hits        17456    17456           
  Misses       2392     2392           
Flag Coverage Δ
jni 66.34% <ø> (ø)
jnigen 82.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
code_assets 94.96% <ø> (ø)
data_assets 91.56% <ø> (ø)
ffi 100.00% <ø> (ø)
ffigen 91.45% <ø> (ø)
hooks 86.40% <ø> (ø)
hooks_runner 90.52% <ø> (ø)
jni 66.34% <ø> (ø)
jni_flutter ∅ <ø> (∅)
jni_util 25.00% <ø> (ø)
jnigen 82.85% <ø> (ø)
json_syntax_generator ∅ <ø> (∅)
native_test_helpers 85.71% <ø> (ø)
native_toolchain_c 95.97% <ø> (ø)
objective_c 79.53% <ø> (ø)
pub_formats ∅ <ø> (∅)
record_use 81.48% <ø> (ø)
snippet_tool 66.23% <ø> (ø)
swift2objc 92.95% <ø> (ø)
swiftgen 80.41% <ø> (ø)
test_case_selector 97.28% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@goderbauer
goderbauer force-pushed the jnigen-fix-test-races branch from b7601ee to 452d90c Compare October 27, 2026 10:18
@github-actions github-actions Bot removed the type-infra A repository infrastructure change or enhancement label Oct 27, 2026
@goderbauer
goderbauer merged commit 035f4ef into dart-lang:main Oct 30, 2026
66 checks passed
@goderbauer
goderbauer deleted the jnigen-fix-test-races branch October 30, 2026 08:23
copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Nov 4, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart native`.

native (https://github.com/dart-lang/native/compare/e0ca7c6..b442038):
  b442038de  Mon Nov 2 10:46:15 2026 -0800  Brian Quinlan  [objective_c] support `scheduleInRunLoop:forMode:` (dart-lang/native#3763)
  264318e75  Fri Oct 30 12:49:03 2026 -0700  Brian Quinlan  [objective_c] fix `toNSInputStream` double copy (dart-lang/native#3762)
  63f3e8641  Fri Oct 30 12:09:04 2026 -0700  Brian Quinlan  [objective_c] avoid an extra copy in `toNSData`  (dart-lang/native#3761)
  ad203b01d  Fri Oct 30 11:48:15 2026 -0700  Brian Quinlan  [objective_c] increase read chunk size (dart-lang/native#3760)
  fa112d95b  Fri Oct 30 09:14:23 2026 -0700  Brian Quinlan  [objective_c] Fix a `NSInputStream` hang (dart-lang/native#3751)
  035f4ef38  Fri Oct 30 09:23:30 2026 +0100  Michael Goderbauer  [jnigen] Fix race conditions in tests (dart-lang/native#3767)
  d58a8f514  Fri Oct 30 00:57:49 2026 -0400  Jhin Lee  [code_assets] Preserve full Apple deployment versions (dart-lang/native#3742)

Migrate `MacOSCodeConfig` in `pkg/dartdev/lib/src/native_assets.dart` from the
deprecated `targetVersion` parameter to `deploymentVersion: AppleVersion(...)`.

Change-Id: I2df469fc05bda2c1db051f43e803fe5145f7c246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/573102
Auto-Submit: Nate Bosch <[email protected]>
Reviewed-by: Nicholas Shahan <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Ben Konyi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants