Add references to xunit.*.dll to CLRTest.Crossgen.targets (#83413)
authorTomáš Rylek <trylek@microsoft.com>
Tue, 14 Mar 2023 22:59:42 +0000 (23:59 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Mar 2023 22:59:42 +0000 (23:59 +0100)
This change fixes the exceptions thrown from Crossgen2 JIT
interface when JIT tries to resolve tokens from xunit.assert.
As a secondary effect the frequent exception throws triggered
the race condition

https://github.com/dotnet/runtime/issues/81884

triggering non-deterministic native CoreCLR runtime failures on
arm64. I was originally reluctant to fix this primary issue until
the native runtime bug is understood as otherwise this fix would
just cause the issue to stop manifesting without being actually
fixed. As the runtime bug has been fixed by now, I am fixing
Crossgen2 executions to stop hitting these resolution exceptions.

Thanks

Tomas

src/tests/Common/CLRTest.CrossGen.targets

index 850c0c62d9b6d0e1933f2ba563bc46742473f4d4..a69ae678bb32c9aeee9102ab94e79f7c91c8e1d5 100644 (file)
@@ -103,6 +103,7 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then
         echo -o:$__OutputFile>>$__ResponseFile
         echo -r:$CORE_ROOT/System.*.dll>>$__ResponseFile
         echo -r:$CORE_ROOT/Microsoft.*.dll>>$__ResponseFile
+        echo -r:$CORE_ROOT/xunit.*.dll>>$__ResponseFile
         echo -r:$CORE_ROOT/mscorlib.dll>>$__ResponseFile
         echo --verify-type-and-field-layout>>$__ResponseFile
         echo --method-layout:random>>$__ResponseFile
@@ -259,6 +260,7 @@ if defined RunCrossGen2 (
     )
     echo -r:!CORE_ROOT!\System.*.dll>>!__ResponseFile!
     echo -r:!CORE_ROOT!\Microsoft.*.dll>>!__ResponseFile!
+    echo -r:!CORE_ROOT!\xunit.*.dll>>!__ResponseFile!
     echo -r:!CORE_ROOT!\mscorlib.dll>>!__ResponseFile!
     echo -r:!CORE_ROOT!\netstandard.dll>>!__ResponseFile!
     echo -O>>!__ResponseFile!