Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeTests.Get, JitInfoTests, and EnumTests Fail with TestReadyToRun #94189

Closed
ivdiazsa opened this issue Oct 30, 2023 · 2 comments · Fixed by #96423
Closed

TypeTests.Get, JitInfoTests, and EnumTests Fail with TestReadyToRun #94189

ivdiazsa opened this issue Oct 30, 2023 · 2 comments · Fixed by #96423

Comments

@ivdiazsa
Copy link
Member

ivdiazsa commented Oct 30, 2023

PR #91229 adds a new pipeline to run libraries tests with ReadyToRun, by means of the MSBuild flag -p:TestReadyToRun=true. However, there are a few tests that are currently incompatible with TestReadyToRun. This issue is to track the necessary work to fix them.

To reproduce the issue:

# Get the runtime repo
git clone https://github.com/dotnet/runtime
cd runtime

# Build the clr and libraries
./build.sh --subset clr+libs --configuration Release

# Run the smoke libraries tests with TestReadyToRun enabled
./build.sh --subset libs.tests --configuration Release --test -p:TestReadyToRun=true -p:RunSmokeTestsOnly=true

Here's an extract of the log with the failing tests:

2023-10-30T21:42:44.7980630Z   [FAIL] System.Tests.TypeTests.GetInterface_Invoke_ReturnsExpected(type: typeof(T), name: "Interface1", ignoreCase: False, expected: typeof(Interface1))
2023-10-30T21:42:44.7983860Z   Assert.Equal() Failure: Values differ
2023-10-30T21:42:44.7985140Z   Expected: typeof(Interface1)
2023-10-30T21:42:44.7986610Z   Actual:   null
2023-10-30T21:42:44.7988640Z      at System.Tests.TypeTests.GetInterface_Invoke_ReturnsExpected(Type type, String name, Boolean ignoreCase, Type expected) in /_/src/libraries/System.Runtime/tests/System/Type/TypeTests.Get.cs:line 62
2023-10-30T21:42:44.7991570Z      at InvokeStub_TypeTests.GetInterface_Invoke_ReturnsExpected(Object, Span`1)
2023-10-30T21:42:44.7993840Z      at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
...
2023-10-30T21:42:45.1896200Z   [FAIL] System.Runtime.Tests.JitInfoTests.JitInfoCurrentThreadIsPopulated
2023-10-30T21:42:45.1924040Z   Thread 1 before compilation time not greater than 0! (00:00:00)
2023-10-30T21:42:45.1925840Z      at System.Runtime.Tests.JitInfoTests.JitInfoCurrentThreadIsPopulated() in /_/src/libraries/System.Runtime/tests/System/Runtime/JitInfoTests.cs:line 146
2023-10-30T21:42:45.1927800Z      at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
2023-10-30T21:42:45.1929330Z      at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
...
2023-10-30T21:42:49.0186060Z   [FAIL] System.Tests.EnumTests.EnumConstraint_ThrowsArgumentException
2023-10-30T21:42:49.0295080Z   Assert.True() Failure
2023-10-30T21:42:49.0298600Z   Expected: True
2023-10-30T21:42:49.0301490Z   Actual:   False
2023-10-30T21:42:49.0305910Z      at System.Tests.EnumTests.EnumConstraint_ThrowsArgumentException() in /_/src/libraries/System.Runtime/tests/System/EnumTests.cs:line 1605
2023-10-30T21:42:49.0310910Z      at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
2023-10-30T21:42:49.0315640Z      at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
@ghost
Copy link

ghost commented Oct 30, 2023

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

PR #91229 adds a new pipeline to run libraries tests with ReadyToRun, by means of the MSBuild flag -p:TestReadyToRun=true. However, there are a few tests that are currently incompatible with TestReadyToRun. This issue is to track the necessary work to fix them.

To reproduce the issue:

# Get the runtime repo
git clone https://github.com/dotnet/runtime
cd runtime

# Build the clr and libraries
./build.sh --subset clr+libs --configuration Release

# Run the smoke libraries tests with TestReadyToRun enabled
./build.sh --subset libs.tests --configuration Release --test -p:TestReadyToRun=true -p:RunSmokeTestsOnly=true

Here's an extract of the log with the failing tests:

2023-10-30T21:42:44.7980630Z   [FAIL] System.Tests.TypeTests.GetInterface_Invoke_ReturnsExpected(type: typeof(T), name: "Interface1", ignoreCase: False, expected: typeof(Interface1))
2023-10-30T21:42:44.7983860Z   Assert.Equal() Failure: Values differ
2023-10-30T21:42:44.7985140Z   Expected: typeof(Interface1)
2023-10-30T21:42:44.7986610Z   Actual:   null
2023-10-30T21:42:44.7988640Z      at System.Tests.TypeTests.GetInterface_Invoke_ReturnsExpected(Type type, String name, Boolean ignoreCase, Type expected) in /_/src/libraries/System.Runtime/tests/System/Type/TypeTests.Get.cs:line 62
2023-10-30T21:42:44.7991570Z      at InvokeStub_TypeTests.GetInterface_Invoke_ReturnsExpected(Object, Span`1)
2023-10-30T21:42:44.7993840Z      at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Author: ivdiazsa
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: Future

@MichalStrehovsky
Copy link
Member

I'm changing the area to crossgen2 - this is not an infra issue - some of this looks like a test issue where the test needs to be adapted, other looks like actual product bug in crossgen2.

@jkotas jkotas modified the milestones: Future, 9.0.0 Oct 31, 2023
jkotas added a commit to jkotas/runtime that referenced this issue Jan 2, 2024
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 2, 2024
ivdiazsa pushed a commit that referenced this issue Jan 4, 2024
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants