-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
Description
In a PR where we have $(EnableLLVM) working on Android in .NET 7: dotnet/android#7188
Some of our unit tests fail with:
System.InvalidOperationException : InvalidOperation_EnumEnded
at System.ArrayEnumerator.get_Current()
at Cadenza.Collections.Tests.CollectionContract`1[[System.Int16, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].DisposeCollection(IEnumerable c)
at Cadenza.Collections.Tests.CollectionContract`1[[System.Int16, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CopyTo()
at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
I think it's just the result of foreach over an array twice?
- https://github.com/xamarin/java.interop/blob/a3de91efdaec04b3927b755a07018e8d26cfdc71/tests/Java.Interop-Tests/Cadenza.Collections/CollectionContract.cs#L205-L221
- https://github.com/xamarin/java.interop/blob/a3de91efdaec04b3927b755a07018e8d26cfdc71/tests/Java.Interop-Tests/Cadenza.Collections/CollectionContract.cs#L85-L86
Reproduction Steps
Build my branch on dotnet/android#7188 in Release mode, I will try to merge it with tests disabled to make this easier.
Then run the test:
./dotnet-local.sh build tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj -t:Install,RunTestApks -c Release
I can also share the .apk file if that helps.
Expected behavior
We shouldn't get InvalidOperation_EnumEnded.
Actual behavior
We get InvalidOperation_EnumEnded.
Regression?
These tests are working in .NET 6.
Known Workarounds
Don't use -p:EnableLLVM=true.
Configuration
.NET 7.0.100-rc.1.22374.1 SDK
Other information
No response