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
When building and running System.Threading.Threads.Tests with TestReadyToRun=true, the test run will crash and fail with an error about a missing file.
Reproduction Steps
Clone the repo and build the clr and libs subsets. Make sure you specify TestReadyToRun, so that some necessary pretest components get built.
[ConditionalTheory(typeof(PlatformDetection),nameof(PlatformDetection.IsNotWindowsNanoServer),nameof(PlatformDetection.IsNotMobile),nameof(PlatformDetection.HasHostExecutable))][InlineData("STAMain.exe","GetApartmentStateTest")][InlineData("STAMain.exe","SetApartmentStateTest")][InlineData("STAMain.exe","WaitAllNotSupportedOnSta_Test0")][InlineData("STAMain.exe","WaitAllNotSupportedOnSta_Test1")][InlineData("MTAMain.exe","GetApartmentStateTest")][InlineData("MTAMain.exe","SetApartmentStateTest")][InlineData("DefaultApartmentStateMain.exe","GetApartmentStateTest")][InlineData("DefaultApartmentStateMain.exe","SetApartmentStateTest")][ActiveIssue("https://github.com/dotnet/runtime/issues/34543",TestPlatforms.Windows,TargetFrameworkMonikers.Netcoreapp,TestRuntimes.Mono)]// Comment this one out --> [ActiveIssue("https://github.com/dotnet/runtime/issues/96722", typeof(PlatformDetection), nameof(PlatformDetection.IsReadyToRunCompiled))]publicstaticvoidApartmentState_AttributePresent(stringappName,stringtestName){varpsi=newProcessStartInfo();psi.FileName=DummyClass.HostRunnerTest;psi.Arguments=$"{appName}{testName}";using(Processp=Process.Start(psi)){p.WaitForExit();Assert.Equal(PlatformDetection.IsWindows?0:2,p.ExitCode);}}
Build and run the test
cd src/libraries/System.Threading.Thread/tests
/path/to/runtime/dotnet.sh build -c Release -t:Test -p:TestReadyToRun=true
Expected behavior
All tests pass, except the skipped ones.
Actual behavior
Test fails with the following error, making the whole run fail:
========================= Begin custom configuration settings ==============================
export __TestArchitecture=x64
export __IsXUnitLogCheckerSupported=1
========================== End custom configuration settings ===============================
----- start Tue Jan 9 01:54:11 PM PST 2024 =============== To repro directly: =====================================================
pushd /path/to/runtime/artifacts/bin/System.Threading.Thread.Tests/Release/net9.0/publish
chmod +rwx System.Threading.Thread.Tests ^&^& ./System.Threading.Thread.Tests -notrait category=OuterLoop -notrait category=failing -xml testResults.xml
popd
===========================================================================================================
/path/to/runtime/artifacts/bin/System.Threading.Thread.Tests/Release/net9.0/publish /path/to/runtime/src/libraries/System.Threading.Thread/tests
Running assembly:System.Threading.Thread.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
[SKIP] System.Threading.Threads.Tests.ThreadTests.DefaultPrincipalPolicyTest
[SKIP] System.Threading.Threads.Tests.ThreadTests.ApartmentState_NoAttributePresent_DefaultState_Nano
[SKIP] System.Threading.Threads.Tests.ThreadTests.ApartmentStateTest_ChangeBeforeThreadStarted_Windows_Nano_Server
[FAIL] System.Threading.Threads.Tests.ThreadTests.ApartmentState_AttributePresent(appName: "STAMain.exe", testName: "GetApartmentStateTest")
System.InvalidOperationException : Cannot start process because a file name has not been provided.
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Threading.Threads.Tests.ThreadTests.ApartmentState_AttributePresent(String appName, String testName) in /path/to/runtime/src/libraries/System.Threading.Thread/tests/ThreadTests.cs:line 178
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
Regression?
No
Known Workarounds
Keep the test disabled so that the other tests in the run can be executed unaffected.
Description
When building and running
System.Threading.Threads.TestswithTestReadyToRun=true, the test run will crash and fail with an error about a missing file.Reproduction Steps
clrandlibssubsets. Make sure you specifyTestReadyToRun, so that some necessary pretest components get built.git clone https://github.com/dotnet/runtime cd runtime ./build.sh --subset clr+libs --configuration Release -p:TestReadyToRun=trueActiveIssueannotation insrc/libraries/System.Threading.Thread/tests/ThreadTests.cs:cd src/libraries/System.Threading.Thread/tests /path/to/runtime/dotnet.sh build -c Release -t:Test -p:TestReadyToRun=trueExpected behavior
All tests pass, except the skipped ones.
Actual behavior
Test fails with the following error, making the whole run fail:
Regression?
No
Known Workarounds
Keep the test disabled so that the other tests in the run can be executed unaffected.