Repository navigation
Closed
Milestone
Description
Several tests from System.Collections fail on Android
System.Collections.NonGeneric.Tests:
- System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Ctor_CultureInfo_GetHashCodeCompare_TurkishI
- System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Default_Compare_TurkishI
- System.Collections.Tests.CaseInsensitiveComparerTests.Ctor_CultureInfo_Compare_TurkishI
<test name="System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Ctor_CultureInfo_GetHashCodeCompare_TurkishI" type="System.Collections.Tests.CaseInsensitiveHashCodeProviderTests" method="Ctor_CultureInfo_GetHashCodeCompare_TurkishI" time="0.032986" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
<message><![CDATA[Assert.Equal() Failure\nExpected: False\nActual: True]]></message>
<stack-trace><![CDATA[ at System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Ctor_CultureInfo_GetHashCodeCompare_TurkishI() in /Users/mdhwang/runtime/src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs:line 140
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/mdhwang/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 359]]></stack-trace>
</failure>
</test>
<test name="System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Default_Compare_TurkishI" type="System.Collections.Tests.CaseInsensitiveHashCodeProviderTests" method="Default_Compare_TurkishI" time="0.002206" result="Fail">
<failure exception-type="Xunit.Sdk.FalseException">
<message><![CDATA[Assert.False() Failure\nExpected: False\nActual: True]]></message>
<stack-trace><![CDATA[ at System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Default_Compare_TurkishI() in /Users/mdhwang/runtime/src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs:line 181
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/mdhwang/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 359]]></stack-trace>
</failure>
</test>
<test name="System.Collections.Tests.CaseInsensitiveComparerTests.Ctor_CultureInfo_Compare_TurkishI" type="System.Collections.Tests.CaseInsensitiveComparerTests" method="Ctor_CultureInfo_Compare_TurkishI" time="0.001527" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
<message><![CDATA[Assert.Equal() Failure\nExpected: 1\nActual: 0]]></message>
<stack-trace><![CDATA[ at System.Collections.Tests.CaseInsensitiveComparerTests.Ctor_CultureInfo_Compare_TurkishI() in /Users/mdhwang/runtime/src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveComparerTests.cs:line 105
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/mdhwang/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 359]]></stack-trace>
</failure>
</test>
Activity
[-]System.Collections tests fail on Android[/-][+]System.Collections.NonGeneric.Tests tests fail on Android[/+][-]System.Collections.NonGeneric.Tests tests fail on Android[/-][+]System.Collections.NonGeneric.Tests and System.Collections.Specialized.Tests tests fail on Android[/+][-]System.Collections.NonGeneric.Tests and System.Collections.Specialized.Tests tests fail on Android[/-][+][Libraries][Android] Turkish Culture edge cade System.Collections.NonGeneric.Tests fail on Android[/+]mdh1418 commentedon Aug 6, 2021
#56407 may be related with respect to Turkish culture failing.
danmoseley commentedon Aug 6, 2021
It's the same issue. The special casing behavior of Turkish I. This isn't new so even if these devices have old ICU it ought to work. @tarekgh have you seen this fail?
tarekgh commentedon Aug 6, 2021
It looks to me on Android there is one of the following cultures have
Turkish Ibehavior.I suggested if we can manually check that on the failed device or at least update the test to print the culture name that is failed.
danmoseley commentedon Aug 6, 2021
@mdh1418 can you update the assert of one of these tests to dump the culture name eg
https://github.com/danmoseley/runtime/blob/b432e9892e8cf10d30891f207dbccb4b3de2c3df/src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs#L93
mdh1418 commentedon Aug 6, 2021
@danmoseley @tarekgh
So it looks like
provider.GetHashCode("file")andprovider.GetHashCode("FILE")are incorrectly the same for tr-TR.tarekgh commentedon Aug 6, 2021
In this case the issue would be related to the ICU used in Android or Mono could be doing something different than coreclr.
https://source.dot.net/#System.Private.CoreLib/CompareInfo.Icu.cs,739
danmoseley commentedon Aug 6, 2021
@mdh1418 what version of libicu is on this device?
I'm not sure where it is or the file name, but eg on Ubuntu I have
I wonder whether it's particular to this Android version/distribution that it hasn't come up before. Windows has had this behavior for nearly 20 years so I would be surprised if it was only recently fixed in ICU/CLDR.
danmoseley commentedon Aug 6, 2021
Either way, it's very unlikely that we can do anything about it. The only question in my mind is whether this is true for all Android flavors, and whether we're testing on one that should be updated.
tarekgh commentedon Aug 6, 2021
I believe Android has customized version of ICU, so the version wouldn't help much here. We need to confirm if this is issue with the ICU version installed on Android or there is something different between Mono and coreclr in such code path.
@danmoseley just FYI, on Ubuntu, you can get the ICU version by running the command
uconv -Vsteveisok commentedon Aug 6, 2021
The ICU version is set to the API level. This table shows the breakdown. It's unknown how much they customize, but there clearly are subtle differences between desktop, Android, and what we provide in iOS. Also, there theoretically could be differences between devices / carriers as I believe they have full control over what Android they ship.
danmoseley commentedon Aug 6, 2021
This appears to suggest that the behavior was supported starting in v28, but your table shows that as the lowest version.
https://www.unicode.org/cldr/cldr-aux/charts/28/delta/transform-tr-Lower.html
[-][Libraries][Android] Turkish Culture edge cade System.Collections.NonGeneric.Tests fail on Android[/-][+][Libraries][Android] Turkish Culture edge case System.Collections.NonGeneric.Tests fail on Android[/+]steveisok commentedon Jul 7, 2022
I believe there's nothing we can really do about this since Android controls what ICU they ship. I'm going to close this issue, but anyone feels otherwise, please reopen.