Repository navigation
Closed
Labels
closed:doneis:bugrequires:backportRequires backportint to the v3 branchRequires backportint to the v3 branch
Milestone
Description
NUnit Version: 3.13.3
OS: Microsoft Windows 10.0.19042
Runtime: .NET 6.0.9
STR:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.0-rc.1" />
</ItemGroup>
</Project>
using NUnit.Framework;
namespace Tests.NUnit
{
public class Tests
{
[Test]
public void Test1() { }
}
}
- Compile the project
- Run the tests
nunit3-console.exe <PATH_TO_TEST_DLL>
Expected result:
- Tests passes
Actual result:
nunit3-console.exefails with stack overflow
NUnit Console 3.15.2 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
28 ?????? 2565 11:51:53
Runtime Environment
OS Version: Microsoft Windows 10.0.19042
Runtime: .NET 6.0.9
Test Files
c:\Users\jetbrains\source\repos\UT.Frameworks\Tests.NUnit\bin\Debug\net6.0\Tests.NUnit.dll
Stack overflow.
at System.Globalization.CompareInfo.IcuIndexOfCore(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>, System.Globalization.CompareOptions, Int32*, Boolean)
at System.Globalization.CompareInfo.IndexOfCore(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>, System.Globalization.CompareOptions, Int32*, Boolean)
at System.Globalization.CompareInfo.LastIndexOf(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>, System.Globalization.CompareOptions)
at System.Globalization.CompareInfo.LastIndexOf(System.String, System.String, Int32, Int32, System.Globalization.CompareOptions)
at System.String.LastIndexOf(System.String, Int32, Int32, System.StringComparison)
at System.String.LastIndexOf(System.String)
at NUnit.Framework.Internal.Builders.NamespaceTreeBuilder.GetNamespaceSuite(System.String)
<<< Many more GetNamespaceSuite calls here >>>
at NUnit.Framework.Internal.Builders.NamespaceTreeBuilder.GetNamespaceSuite(System.String)
at NUnit.Framework.Internal.Builders.NamespaceTreeBuilder.Add(NUnit.Framework.Internal.TestSuite)
at NUnit.Framework.Internal.Builders.NamespaceTreeBuilder.Add(System.Collections.Generic.IList`1<NUnit.Framework.Internal.Test>)
at NUnit.Framework.Api.DefaultTestAssemblyBuilder.BuildTestAssembly(System.Reflection.Assembly, System.String, System.Collections.Generic.IList`1<NUnit.Framework.Internal.Test>)
at NUnit.Framework.Api.DefaultTestAssemblyBuilder.Build(System.Reflection.Assembly, System.String, System.Collections.Generic.IDictionary`2<System.String,System.Object>)
at NUnit.Framework.Api.DefaultTestAssemblyBuilder.Build(System.Reflection.Assembly, System.Collections.Generic.IDictionary`2<System.String,System.Object>)
at NUnit.Framework.Api.NUnitTestAssemblyRunner+<>c__DisplayClass34_0.<Load>b__0()
at NUnit.Framework.Api.NUnitTestAssemblyRunner.WrapInNUnitCallContext(System.Action)
at NUnit.Framework.Api.NUnitTestAssemblyRunner.Load(System.Reflection.Assembly, System.Collections.Generic.IDictionary`2<System.String,System.Object>)
at NUnit.Framework.Api.FrameworkController.LoadTests()
at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
at System.Reflection.MethodBase.Invoke(System.Object, System.Object[])
at NUnit.Engine.Drivers.NUnitNetCore31Driver.ExecuteMethod(System.Reflection.MethodInfo, System.Object[])
at NUnit.Engine.Drivers.NUnitNetCore31Driver.ExecuteMethod(System.String, System.Object[])
at NUnit.Engine.Drivers.NUnitNetCore31Driver.Load(System.String, System.Collections.Generic.IDictionary`2<System.String,System.Object>)
at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(NUnit.Engine.Extensibility.IFrameworkDriver, System.String, NUnit.Engine.TestPackage)
at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
at NUnit.Engine.Runners.DirectTestRunner.RunTests(NUnit.Engine.ITestEventListener, NUnit.Engine.TestFilter)
at NUnit.Engine.Runners.AbstractTestRunner.Run(NUnit.Engine.ITestEventListener, NUnit.Engine.TestFilter)
at NUnit.Engine.Runners.MasterTestRunner.RunTests(NUnit.Engine.ITestEventListener, NUnit.Engine.TestFilter)
at NUnit.Engine.Runners.MasterTestRunner.Run(NUnit.Engine.ITestEventListener, NUnit.Engine.TestFilter)
at NUnit.ConsoleRunner.ConsoleRunner.RunTests(NUnit.Engine.TestPackage, NUnit.Engine.TestFilter)
at NUnit.ConsoleRunner.ConsoleRunner.Execute()
at NUnit.ConsoleRunner.Program.Main(System.String[])
Reacted by NewITCorp
Metadata
Metadata
Assignees
Labels
closed:doneis:bugrequires:backportRequires backportint to the v3 branchRequires backportint to the v3 branch

Activity
stevenaw commentedon Oct 29, 2022
Thanks @estrizhok
I'm going to label this as
confirmto see if it's still happening in the current codebase. The line which seems to be triggering this has changed inmasterbranch since the 3.13.3 release and it would be good to confirm if any existing fix should be backported.charinstead of astringafter 3.13.3 was releasedstevenaw commentedon Oct 29, 2022
Ok, I can confirm that this is happening on the latest 3.13.x code, as well as that I suspect it to be fixed on master via #3770
It is also reproducible on .NET6 and not .NET Core 3.1. I suspect it could be related to differences in the NLS vs ICU globalization tables.
We may want to consider applying the changes in #3770 to
v3.13-devAlso of note here is that this happens when the machine localization settings are
th-THbut NOT when applying the culture to a test directly via the[SetCulture("th-TH")]attributestevenaw commentedon Oct 29, 2022
Confirmed as an NLS vs ICU issue. Adding the below to the csproj file on Windows should work around the issue on affected runtimes until this can be fixed.
https://learn.microsoft.com/en-us/dotnet/core/extensions/globalization-icu#use-nls-instead-of-icu
stevenaw commentedon Mar 24, 2023
@estrizhok I recall you mentioning in another issue that you've been testing localization in Rider. Did the RuntimeHostConfigurationOption workaround work in your case or is this still an issue you're facing?
stevenaw commentedon Apr 8, 2023
@OsirisTerje Adding this to 3.14 as I'd like to include this in a 3.x release too. This has been "broken" for a while and while there is a work around I think it'd be nice to avoid asking our users to apply it. I'll be trying to tackle this early next week. I believe it's quite simple, there's just a very minor merge conflict to resolve as part of it.
It can be bumped out of 3.14 if a release goes out before this can get in.