chore: Add AppHost validation to DisassemblyDiagniser on macos environment#3080
chore: Add AppHost validation to DisassemblyDiagniser on macos environment#3080filzrev wants to merge 1 commit intodotnet:masterfrom
Conversation
| var entryAssembly = Assembly.GetEntryAssembly(); | ||
|
|
||
| // Check NativeAOT | ||
| if (entryAssembly == null) |
There was a problem hiding this comment.
GetEntryAssembly also returns null in test frameworks, so this doesn't even catch the issue you found.
There was a problem hiding this comment.
GetEntryAssembly also returns null in test frameworks
Is it able to provide code/environment that reproduce issue?
I've testes AppHostDetector.cs behavior on Windows with following combinations .
But it can't reproduce issue.
- Use xUnit.v2/v3.
- Use VSTest/MTP mode.
- Run tests by using TestExplorer/dotnet run/run exe
As far as I've confirmed testhost.dll is resolved as entry assembly when using xunit.v2.
And test DLL is resolved when using xunit.v3.
There was a problem hiding this comment.
In my first prototype of #2682 I tried using it and found it to return null in the test framework. 35b0082#diff-3e3d929255c5bc775e61d756a968c3a994409c578dba06e5630745484c7ce62bR52-R54
There was a problem hiding this comment.
There was a problem hiding this comment.
That was using the old manual running multiple frameworks test project, which at the time was using an ancient version of xUnit, so maybe it's doesn't repro anymore. But it seems unreliable at least.
|
Close this PR. ClrMD 4.x seems support So macOS specific workaround code can be removed after updated to ClrMD 4.x |
This PR add AppHost validation to DisassemblyDiagniser on macos environment.
As commented on #3076.
Currently DisassemblyDiagniser cause freeze when following conditions met.
By this PR it can avoid unintended benchmark freeze problem.