-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Don't use WeakReferences in the BF round trip test #106967
Merged
Merged
Conversation
This file contains 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
…t freed in the meantime, fixes dotnet#104905
adamsitnik
added
area-System.Resources
test-enhancement
Improvements of test source code
labels
Aug 26, 2024
Open
3 tasks
bartonjs
approved these changes
Aug 28, 2024
lonitra
approved these changes
Aug 28, 2024
/ba-g the timeouts are unrelated |
adamsitnik
added a commit
to adamsitnik/runtime
that referenced
this pull request
Sep 9, 2024
…t freed in the meantime, fixes dotnet#104905 (dotnet#106967)
carlossanlop
pushed a commit
that referenced
this pull request
Sep 17, 2024
* Remove package references from library tests (#106737) * Remove package references from library tests These tests should be referencing the product assemblies so that they test latest and not old bits. * Reference the OOB version of SRSF and make sure it's copied * BinaryFormatter tests should be skipped only on AOT, WASM and Mobile (#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from #104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string> * Don't use WeakReferences in the round trip test, as the target may get freed in the meantime, fixes #104905 (#106967) * Enable more BinaryFormatter tests (#107408) * enable the BinaryFormatter tests in System.Runtime.Serialization.Formatters.Tests * add new test project, where the flag is disabled and it runs only 3 tests in total that ensure that * The SerializationGuard is no longer activated since BF was moved to the OOB package, the tests need to reflect that. * Disable binary formatter tests when DotNetBuildSourceOnly. (#107549) * [mono][tvos] Do not treat assembly.pdb/xml files as native files to bundle when AOTing on Helix (#107079) * Do not treat assembly.pdb/xml files as native files to bundle * Bundle satellite assemblies as well * [mono][ci] Include PDBs from runtime pack when building on Helix if required (#107348) --------- Co-authored-by: Eric StJohn <[email protected]> Co-authored-by: Tom Deseyn <[email protected]> Co-authored-by: Ivan Povazan <[email protected]>
carlossanlop
pushed a commit
that referenced
this pull request
Sep 17, 2024
…107903) * Remove package references from library tests (#106737) * Remove package references from library tests These tests should be referencing the product assemblies so that they test latest and not old bits. * Reference the OOB version of SRSF and make sure it's copied * BinaryFormatter tests should be skipped only on AOT, WASM and Mobile (#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from #104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string> * Don't use WeakReferences in the round trip test, as the target may get freed in the meantime, fixes #104905 (#106967) * Enable more BinaryFormatter tests (#107408) * enable the BinaryFormatter tests in System.Runtime.Serialization.Formatters.Tests * add new test project, where the flag is disabled and it runs only 3 tests in total that ensure that * The SerializationGuard is no longer activated since BF was moved to the OOB package, the tests need to reflect that. * Disable binary formatter tests when DotNetBuildSourceOnly. (#107549) * [mono][tvos] Do not treat assembly.pdb/xml files as native files to bundle when AOTing on Helix (#107079) * Do not treat assembly.pdb/xml files as native files to bundle * Bundle satellite assemblies as well * [mono][ci] Include PDBs from runtime pack when building on Helix if required (#107348) --------- Co-authored-by: Eric StJohn <[email protected]> Co-authored-by: Adam Sitnik <[email protected]> Co-authored-by: Tom Deseyn <[email protected]> Co-authored-by: Ivan Povazan <[email protected]>
jtschuster
pushed a commit
to jtschuster/runtime
that referenced
this pull request
Sep 17, 2024
…t freed in the meantime, fixes dotnet#104905 (dotnet#106967)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In #105072 I've tried to fix #104905 by rooting the argument provided to the test method.
It turned out to be incomplete, as this test performs a full round trip (serialize -> deserialize) and I was not rooting the deserialized weak reference target:
runtime/src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/FormattedObject/BasicObjectTests.cs
Line 23 in b579962
I could try to do that by doing sth like this:
But in theory GC could free the
WeakReference
target after it got deserialized by BF, but before returned fromBinaryFormatter.Deserialize
. Since this test was flaky for a while and I don't ever want to hear about it, I propose to simply don't test weak references for this particular scenario (it's used by other tests so no worries)fixes #104905