You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Triage tests regressing by building managed tests on OSX #36404
The following test started regressing (currently in the `dev/infrastructure branch) as a result of the #36253 change to start building all managed test assemblies on OSX.
They will be disabled (in the `dev/infrastructure branch) as part of #36351
<!-- Fixed by #36482-->
<ExcludeListInclude="$(XunitTestBinBase)/readytorun/tests/mainv**/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/ComWrappers/GlobalInstance/GlobalInstanceMarshallingTests/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/ComWrappers/GlobalInstance/GlobalInstanceTrackerSupportTests/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NativeClients/DefaultInterfaces/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NativeClients/Dispatch/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NativeClients/Events/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NativeClients/Licensing/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NativeClients/Primitives/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/COM/NETClients/ConsumeNETServer/ConsumeNETServer/*"/>
<!-- Regressions apparently caused by building all tests on OSX/Linux Oddly these pass when the helix payload is downloaded and the test is run locally-->
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/FixupCallsHostWhenLoaded/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/ManagedCallingNative/ManagedCallingNative/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/NativeCallingManaged/NativeCallingManaged/*"/>
<ExcludeListInclude="$(XunitTestBinBase)/Interop/IJW/NativeVarargs/NativeVarargsTest/*"/>
So the native assets are supposed to be built on the target during the run-test-job.
Are these not hooked up properly so that they are being built during build-tests skipnative?
They should be hooked up to build via the build-tests, but won't get built with build-tests skipnative. The native assets would build with build-tests skipmanaged. Some of those assets come from the same place as CoreRun, others come from the native project output path.
Interop\IJW\NativeCallingManaged\NativeCallingManaged\NativeCallingManaged.cmd [FAIL]
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'IjwNativeCallingManagedDll, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'IjwNativeCallingManagedDll, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(String assemblyString)
at IjwHelper.LoadIjwAssembly(String name) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/IjwHelper.cs:line 20
at NativeCallingManaged.NativeCallingManaged.Main(String[] args) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.cs:line 23
Return code: 1
Raw output file: C:\h\w\97700803\w\B4A8097E\e\Interop\IJW\Reports\Interop.IJW\NativeCallingManaged\NativeCallingManaged\NativeCallingManaged.output.txt
Raw output:
BEGIN EXECUTION
"C:\h\w\97700803\p/corerun.exe" NativeCallingManaged.dll
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\97700803\p
> C:\h\w\97700803\w\B4A8097E\e\Interop\IJW\NativeCallingManaged\NativeCallingManaged\NativeCallingManaged.cmd
Expected: True
Actual: False
Stack Trace:
F:\workspace\_work\1\s\artifacts\tests\coreclr\Windows_NT.x64.Checked\TestWrappers\Interop.IJW\Interop.IJW.XUnitWrapper.cs(528,0): at Interop_IJW._NativeCallingManaged_NativeCallingManaged_NativeCallingManaged_._NativeCallingManaged_NativeCallingManaged_NativeCallingManaged_cmd()
Output:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'IjwNativeCallingManagedDll, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'IjwNativeCallingManagedDll, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(String assemblyString)
at IjwHelper.LoadIjwAssembly(String name) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/IjwHelper.cs:line 20
at NativeCallingManaged.NativeCallingManaged.Main(String[] args) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.cs:line 23
Return code: 1
Raw output file: C:\h\w\97700803\w\B4A8097E\e\Interop\IJW\Reports\Interop.IJW\NativeCallingManaged\NativeCallingManaged\NativeCallingManaged.output.txt
Raw output:
BEGIN EXECUTION
"C:\h\w\97700803\p/corerun.exe" NativeCallingManaged.dll
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\97700803\p
> C:\h\w\97700803\w\B4A8097E\e\Interop\IJW\NativeCallingManaged\NativeCallingManaged\NativeCallingManaged.cmd
The tests downloaded from Helix work on my local machine. Aaron had similar experience with the tests on his machine with his own CORE_ROOT.
We did see that the cmd files do not match what we told MSBUILD to create. The directory separator has been replaced everywhere \ -> /. It is not clear why this is happening.
It is not clear why this works running locally, but not when run with helix.
REM Local CoreShim requested - see MSBuild property 'CLRTestScriptLocalCoreShim'ECHO Copying '%CORE_ROOT%\CoreShim.dll'...
COPY /y %CORE_ROOT%\CoreShim.dll .
But since we are generating in MSBUILD, my working guess is that % is a MSBuild special character and needs to be escaped. Similar to the complaint in
src/runtest.proj: <!-- NOTE! semicolons must be escaped with %3B boooo -->
<!-- Write the file -->
<WriteLinesToFileFile="$(OutputPath)\$(MSBuildProjectName).cmd"Lines="$(_CLRTestExecutionScriptText)"Overwrite="true" />
Needs to become
<!-- Write the file -->
<WriteLinesToFileFile="$(OutputPath)\$(MSBuildProjectName).cmd"Lines="$([MSBuild]::Escape($(_CLRTestExecutionScriptText)))"Overwrite="true" />
@ericstj Also commented about the lack of scalability of WriteLinesToFile. Perhaps that is part of our problem with MSBuild slowness. dotnet/msbuild#4018 (comment)
I think we need to stop using MSBuild as a templating engine.
#36482 switches to building the script files on the correct target.
That fixed most of the issues in the top post.
Strangely the 6 IJW tests fail on helix, but pass when downloaded and run on my local machine.
Interop\IJW\NativeVarargs\NativeVarargsTest\NativeVarargsTest.cmd [FAIL]
Return code: 1
Raw output file: C:\h\w\BE210A03\w\BF4E0A89\e\Interop\IJW\Reports\Interop.IJW\NativeVarargs\NativeVarargsTest\NativeVarargsTest.output.txt
Raw output:
BEGIN EXECUTION
"C:\h\w\BE210A03\p\corerun.exe" NativeVarargsTest.dll
System.IO.FileNotFoundException: Could not load file or assembly 'IjwNativeVarargs, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'IjwNativeVarargs, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(String assemblyString)
at IjwHelper.LoadIjwAssembly(String name) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/IjwHelper.cs:line 20
at NativeVarargsTest.NativeVarargsTest.Main(String[] args) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/NativeVarargs/NativeVarargsTest.cs:line 52
Expected: 100
Actual: 101
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\BE210A03\p
> C:\h\w\BE210A03\w\BF4E0A89\e\Interop\IJW\NativeVarargs\NativeVarargsTest\NativeVarargsTest.cmd
Expected: True
Actual: False
Stack Trace:
F:\workspace\_work\1\s\artifacts\tests\coreclr\Windows_NT.x86.Checked\TestWrappers\Interop.IJW\Interop.IJW.XUnitWrapper.cs(625,0): at Interop_IJW._NativeVarargs_NativeVarargsTest_NativeVarargsTest_._NativeVarargs_NativeVarargsTest_NativeVarargsTest_cmd()
Output:
Return code: 1
Raw output file: C:\h\w\BE210A03\w\BF4E0A89\e\Interop\IJW\Reports\Interop.IJW\NativeVarargs\NativeVarargsTest\NativeVarargsTest.output.txt
Raw output:
BEGIN EXECUTION
"C:\h\w\BE210A03\p\corerun.exe" NativeVarargsTest.dll
System.IO.FileNotFoundException: Could not load file or assembly 'IjwNativeVarargs, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'IjwNativeVarargs, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(String assemblyString)
at IjwHelper.LoadIjwAssembly(String name) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/IjwHelper.cs:line 20
at NativeVarargsTest.NativeVarargsTest.Main(String[] args) in /Users/runner/runners/2.168.2/work/1/s/src/coreclr/tests/src/Interop/IJW/NativeVarargs/NativeVarargsTest.cs:line 52
Expected: 100
Actual: 101
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\BE210A03\p
> C:\h\w\BE210A03\w\BF4E0A89\e\Interop\IJW\NativeVarargs\NativeVarargsTest\NativeVarargsTest.cmd
But why would building managed DLLs on OSX affect that?
Native binaries are built and copied from WIndows like before. I assume IJW managed C++ is treated as native because it is built using CMake. (That is what I saw in my tree)
I was correct. The current way that we copy the debug CRT won't work if we're on OSX. We currently use the None item group to copy it when we build on Windows. This needs to be updated to work in the new workflow.
Activity
AaronRobinsonMSFT commentedon May 13, 2020
@sdmaclea All of the tests under
Interop/require native assets that are only built on Windows.sdmaclea commentedon May 13, 2020
So the native assets are supposed to be built on the target during the
run-test-job.Are these not hooked up properly so that they are being built during
build-tests skipnative?AaronRobinsonMSFT commentedon May 14, 2020
They should be hooked up to build via the
build-tests, but won't get built withbuild-tests skipnative. The native assets would build withbuild-tests skipmanaged. Some of those assets come from the same place asCoreRun, others come from the native project output path.sdmaclea commentedon May 14, 2020
So that shouldn't be the issue. AFAIK, the native assets are being built the same.
I am taking a look at
Interop/IJW/NativeCallingManaged/NativeCallingManaged/*nowsdmaclea commentedon May 14, 2020
So this is what I see in the payload for the test as sent to helix.
sdmaclea commentedon May 14, 2020
sdmaclea commentedon May 14, 2020
It seems to be failing while trying to load the
IjwNativeCallingManagedDll.dllassembly, which seems to be present.AaronRobinsonMSFT commentedon May 14, 2020
Where can I get the binaries from that run?
sdmaclea commentedon May 14, 2020
CORE_ROOT
https://helixde107v0xdeko0k025g8.blob.core.windows.net/helix-job-81984b1d-673f-4c55-8991-8fee22a7d826bcd25907f2545e69d/48dfb514-0e41-4780-bbe6-606df2bab23b.zip?sv=2019-02-02&se=2020-06-02T17%3A12%3A59Z&sr=c&sp=rl&sig=YfBghT8jBGjEygX9h%2Bgoh9AWNYi%2FBTYYH7Nr2IwS6rM%3D
Interop tests
https://helixde107v0xdeko0k025g8.blob.core.windows.net/helix-job-81984b1d-673f-4c55-8991-8fee22a7d826bcd25907f2545e69d/5272378f-401b-42a1-a798-dc01320d7a46.zip?sv=2019-02-02&se=2020-06-02T17%3A12%3A59Z&sr=c&sp=rl&sig=YfBghT8jBGjEygX9h%2Bgoh9AWNYi%2FBTYYH7Nr2IwS6rM%3D
sdmaclea commentedon May 14, 2020
Aaron and I worked on this a bit longer.
The tests downloaded from Helix work on my local machine. Aaron had similar experience with the tests on his machine with his own CORE_ROOT.
We did see that the
cmdfiles do not match what we told MSBUILD to create. The directory separator has been replaced everywhere\->/. It is not clear why this is happening.It is not clear why this works running locally, but not when run with helix.
/cc @trylek @jashook
Thanks @AaronRobinsonMSFT
sdmaclea commentedon May 14, 2020
The typical usage of the directory separator is
But since we are generating in MSBUILD, my working guess is that
%is a MSBuild special character and needs to be escaped. Similar to the complaint inNeeds to become
See https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-escape-special-characters-in-msbuild?view=vs-2019
I'll try this in a separate PR.
Edit
I am thinking
$([MSBuild]::Escape($(_CLRTestExecutionScriptText)))won't work. We need some content treated specially.The correct way to go seems to properly escape the special characters.
The
%characters need to be escaped to%25. https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-special-characters?view=vs-2019sdmaclea commentedon May 14, 2020
OK escaping the
%didn't work.@natemcmaster noted a similar issue with backslash on Linux. dotnet/msbuild#4018 (comment)
Perhaps escaping the backslash would work.
@ericstj Also commented about the lack of scalability of
WriteLinesToFile. Perhaps that is part of our problem with MSBuild slowness. dotnet/msbuild#4018 (comment)I think we need to stop using MSBuild as a templating engine.
sdmaclea commentedon May 16, 2020
#36482 switches to building the script files on the correct target.
That fixed most of the issues in the top post.
Strangely the 6 IJW tests fail on helix, but pass when downloaded and run on my local machine.
jkoritzinsky commentedon May 16, 2020
My guess is that some of the debug vc++ runtime dlls aren't copied over correctly.
sdmaclea commentedon May 16, 2020
But why would building managed DLLs on OSX affect that?
Native binaries are built and copied from WIndows like before. I assume IJW managed C++ is treated as native because it is built using CMake. (That is what I saw in my tree)
jkoritzinsky commentedon May 16, 2020
We do some extra copying of some other files. It's possible that they aren't being copied.
jkoritzinsky commentedon May 18, 2020
I was correct. The current way that we copy the debug CRT won't work if we're on OSX. We currently use the None item group to copy it when we build on Windows. This needs to be updated to work in the new workflow.
runtime/src/coreclr/tests/src/Interop/Interop.settings.targets
Lines 22 to 28 in b927546