-
Notifications
You must be signed in to change notification settings - Fork 28
Fix finalizer tests #1338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix finalizer tests #1338
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider also requesting a review from someone more familiar with Finalizer/WeakReference specification.
LanguageFeatures/FinalizationRegistry/ffi/Finalizer/Finalizer_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/FinalizationRegistry/ffi/Finalizer/Finalizer_A01_t01.dart
Outdated
Show resolved
Hide resolved
await attachToFinalizer(); | ||
// Previous triggerGc move some objects to old space. Do multiple GCs to | ||
// force all objects to old space. | ||
await triggerGcWithDelay(repeat: 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment and additional GCs look very implementation-specific. My understanding is that these tests should only rely on the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finalizer specification says that objects may be collected. So then we cannot have a single test that checks that an object is collected.
@lrhn please advise.
LanguageFeatures/FinalizationRegistry/ffi/Finalizer/attach_A02_t01.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, assuming the remaining comments are addressed.
@dcharkes what is the status of this PR? It is approved but there are still some open questions. If you want I can go on work on this PR |
I think we can land it as is. It does not really make sense to only conform to specification, because that means we cannot test any finalizers (finalizers may run, objects may be GCed). Thanks for pinging the PR @sgrekhov. |
2022-07-13 [email protected] Add initial specparser workflow (dart-lang/co19#1364) 2022-07-07 [email protected] Fixes dart-lang/co19#1355. Expect that `Process.killPid` returns `false` only if process is already dead (dart-lang/co19#1357) 2022-07-06 [email protected] Fixes dart-lang/co19#1328. Fix error expectation places for CFE (dart-lang/co19#1353) 2022-07-05 [email protected] Fixes dart-lang/co19#1309. Update error expectations according to the current behavior (dart-lang/co19#1352) 2022-07-05 [email protected] Fix finalizer tests (dart-lang/co19#1338) 2022-07-04 [email protected] Fixes dart-lang/co19#1343. Use correct 'part' and 'part of' directives (dart-lang/co19#1349) 2022-07-04 [email protected] Fix typos (dart-lang/co19#1341) 2022-07-04 [email protected] Fixes dart-lang/co19#1340. Update expected error locations for CFE (dart-lang/co19#1348) 2022-07-04 [email protected] Fixes dart-lang/co19#1344. Wait for entryPoint is invoked before doing the test (dart-lang/co19#1346) 2022-07-01 [email protected] Fixes dart-lang/co19#1342. Expect STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR for C?.foo (dart-lang/co19#1347) Change-Id: I1d5b116297f4b94930988914de4c0e03b68b2b8d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251463 Reviewed-by: Alexander Thomas <[email protected]>
Closes #1337