FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed CollectBasicObject test by lostmsu · Pull Request #1313 · pythonnet/pythonnet · GitHub

Fixed CollectBasicObject test - #1313

Merged
filmor merged 3 commits into
pythonnet:masterfrom
losttech:bugs/1309
Dec 12, 2020
Merged

Fixed CollectBasicObject test#1313
filmor merged 3 commits into
pythonnet:masterfrom
losttech:bugs/1309

Conversation

lostmsu commented Dec 10, 2020
edited
Loading

Copy link
Copy Markdown
Member

This contains two fixes, that must go along for the tests to pass:

  1. Fixed the CollectBasicObject and CollectOnShutdown tests for Mono by fixing MakeAGarbage function to not keep the garbage on the stack during a conservative roots scan (looks like Mono scans some variables, that are already gone).
  2. Fixed the crash during runtime shutdown by further simplifying Finalizer to only store raw pointers to python objects instead of instances of IPyDisposable and thus replacing Dispose with reliable and simple DecRef.

This removes some functions from Finalizer, which previously were public, but should not have been.

lostmsu force-pushed the bugs/1309 branch 10 times, most recently from 8d89411 to 45c370a Compare December 11, 2020 00:31
lostmsu marked this pull request as ready for review December 11, 2020 02:50

filmor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can't you use one of the *Reference types instead of IntPtr? It would be good to see at least in the code that we are talking about Python objects here.


[Test]
[Ignore("Ignore temporarily")]
[Obsolete("GC tests are not guaranteed")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is NUnit aware of this attribute or does this just generate yet another compile-time warning? Does it help to retry the test using https://docs.nunit.org/articles/nunit/writing-tests/attributes/retry.html?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

NUnit is not aware. This actually removes warning from the usage of other [Obsolete] code.

lostmsu commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

@filmor not for the finalizer. *Reference types can not be stored.

filmor merged commit 6bc85ff into pythonnet:master Dec 12, 2020
lostmsu deleted the bugs/1309 branch December 12, 2020 20:02
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL