| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
:/ it does not fail when the blame mode is on in dotnet test :/ On my own machine I was able to reproduce it on the first try, but then it never reproduced after that. :/ |
Sorry, something went wrong.
|
Looks like the issue may be with the TestThread function. Perhaps we are missing some synchronization there. I previously suspected that it needs memory barriers, because AFAIK acquiring GIL does not insert them. See this run passing on all MacOS versions with that method disabled: https://github.com/pythonnet/pythonnet/actions/runs/2260894105 |
Sorry, something went wrong.
|
This is probably also something that we should include in our docs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I suspect the issue is actually with Mono GC and the relatively new mode of suspending threads, which has a few (closed) bugs against it, complaining about hangs. In many of those bugs (you can find them here) switching to the old preemptive mode works around the issue. I tried it for our tests, and it seems to solve it too.
The issue also vaguely mentioned in https://www.mono-project.com/docs/advanced/runtime/docs/coop-suspend/#thread-startfinish-still-bad
So the fix is to simply set MONO_THREADS_SUSPEND to preemptive in CI before running tests in Mono.
Fixes #1766
This workaround seems to solve the issue on my local machine as well as in CI. I did 5+ CI full matrix reruns to confirm. Before the fix a few MacOS legs would time out in every run.
Below is some history of finding this workaround.