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

[NETSDKE2E]Garbage issue happens in new terminal logger output in CLI on Loc OS. #9674

Closed
vdanche opened this issue Jan 23, 2024 · 10 comments · Fixed by microsoft/vstest#4853
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@vdanche
Copy link
Member

vdanche commented Jan 23, 2024

Issue Description

Garbage issue happens in new terminal logger output in CLI on Loc OS.

Steps to Reproduce

Steps to Reproduce
Affect build:
.NET 9.0.100-alpha.1.24072.8 from dotnet/installer: .NET SDK Installer (github.com)
Affected Product Language:
All loc OS

1.In CLI, dotnet new mstest -o mymstest本地化
2.add below code in UnitTest1.cs

    [TestMethod]
    public void TestMethod1()
    {
        Assert.Inconclusive();
    }

    [TestMethod]
    public void TestMethod2()
    {
        Assert.AreEqual(2, 11);

    }

3.dotnet build
4.dotnet test

Expected Result:
the log can be displayed well.
Actual Result:
Garbage issue happen in logs.
Chinese OS:
image

Turkish:
image

EN(not repro):
image

dotnet --info:
.NET SDK:
Version: 9.0.100-alpha.1.24072.8
Commit: ac061bfeca
Workload version: 9.0.100-manifests.fd1572dc

运行时环境:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24072.8\

已安装 .NET 工作负载:
没有要显示的已安装工作负载。

Host:
Version: 9.0.0-alpha.1.24071.3
Architecture: x64
Commit: 8accd8073a

.NET SDKs installed:
9.0.100-alpha.1.24072.8 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-alpha.1.24069.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-alpha.1.24071.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.0-alpha.1.24071.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Analysis

No response

Versions & Configurations

No response

@vdanche vdanche added bug needs-triage Have yet to determine what bucket this goes in. labels Jan 23, 2024
@vdanche vdanche changed the title [NETSDKE2E]Garbage issue happens in new terminal logger output in CLI. [NETSDKE2E]Garbage issue happens in new terminal logger output in CLI on Loc OS. Jan 23, 2024
@rainersigwald
Copy link
Member

@nohwnd, this is the new test logging experience, right?

@nohwnd
Copy link
Member

nohwnd commented Jan 24, 2024

Yes. Will investigate tomorrow. I looks like encoding issue.

Do you have an idea of a possible cause? I don’t do much in the logger, just write the test names and results to standard output and consume those lines in class VstestTask2 : ToolTask. I replace \n and \r .

@rainersigwald
Copy link
Member

@nohwnd It is completely plausible that you're not doing anything wrong and the encoding problem is happening after your perfectly-ok log messages get to the logger. But I definitely wanted to make sure you were aware of the end-to-end problem.

@nohwnd
Copy link
Member

nohwnd commented Jan 25, 2024

I can repro on my computer, that is using english:

namespace mstest95;

[TestClass]
public class UnitTest1ğ
{
    [TestMethod]
    public void TestMethodğ1()
    {
        Assert.AreEqual(2, 1);
    }
}

image

Investigating.

@nohwnd
Copy link
Member

nohwnd commented Jan 25, 2024

This is indeed encoding issue, seems that the task is not forcing utf8 by default, which we do force in the console unless user opts out. (using this set of characters to test, it works when UTF8 is set "ğğğ𦮙我們剛才從𓋴𓅓𓏏𓇏𓇌𓀀")

@nohwnd
Copy link
Member

nohwnd commented Jan 25, 2024

Will be fixed in the linked PR,
image

Formatting is different because of different SDK version, but we reach MSBuild with the correct string, so this will fix the new output shown above as well.

@vdanche
Copy link
Member Author

vdanche commented Jan 31, 2024

@nohwnd It will be fixed on net9 preview 2 instead of net9 preview 1, right? we checked on 9.0.100-preview.2.24080.8 and still repro, will keep tracking.
image

@nohwnd
Copy link
Member

nohwnd commented Jan 31, 2024

Fix was merged yesterday to net9 main, and few hours ago into net9-preview1. So it should be in both.

@vdanche
Copy link
Member Author

vdanche commented Jan 31, 2024

Fix was merged yesterday to net9 main, and few hours ago into net9-preview1. So it should be in both.

Ok, still repro on today's net9 preview 2 and net9 preview 1. we'll check it on tomorrow build.

@vdanche
Copy link
Member Author

vdanche commented Feb 2, 2024

@nohwnd this issue has been fixed on 9.0.100-preview.1.24101.4 SDK. thanks
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants