Skip to content

Test duration is added instead of being updated (every second) #6753

Closed

Description

Hello all.
Here is the original bug that I opened in TUnit
thomhurst/TUnit#3395
And they redirected me to here.


Disclaimer: I am using TUnit.Playwright package, but with TUnit package alone, this behavior does not exist; it is a possibility that this behavior is caused by Playwright, not TUnit

First of all, thanks for resolving the #3187 issue. I confirm it is solved.
Now, when I run the test like this dotnet run --log-level Warning, I only have the log with Warning and above levels.

But something caught my eye

For every passing second, there are 2 logs.
This is making the log much longer than needed, and prevents the user from focusing on the important information
below is a trimmed example; the real log is much, much longer.
I have some playwright test that runs for 3 minutes, they generate about (3 * 60 * 2 = 3600) logs

████████╗██╗   ██╗███╗   ██╗██╗████████╗
╚══██╔══╝██║   ██║████╗  ██║██║╚══██╔══╝
   ██║   ██║   ██║██╔██╗ ██║██║   ██║
   ██║   ██║   ██║██║╚██╗██║██║   ██║
   ██║   ╚██████╔╝██║ ╚████║██║   ██║
   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚═╝   ╚═╝

   TUnit v0.71.4.0 | 64-bit | Microsoft Windows 10.0.26100 | win-x64 | .NET 9.0.10 | Microsoft Testing Platform v2.0.1

   Engine Mode: SourceGenerated

[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
0s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
1s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
1s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
2s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
2s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
3s)
[✓0/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
3s)


.
.
.
.
.
.
.
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
33s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
33s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
34s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
34s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
35s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
35s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
36s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
36s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
37s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
37s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (
38s)
[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (38s)
  Create with all values for ad                                                                                                                                                                          (10s)

I suggest that at the end of the test, one long is generated with the time that has passed
Here is an example

████████╗██╗   ██╗███╗   ██╗██╗████████╗
╚══██╔══╝██║   ██║████╗  ██║██║╚══██╔══╝
   ██║   ██║   ██║██╔██╗ ██║██║   ██║
   ██║   ██║   ██║██║╚██╗██║██║   ██║
   ██║   ╚██████╔╝██║ ╚████║██║   ██║
   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚═╝   ╚═╝

   TUnit v0.71.4.0 | 64-bit | Microsoft Windows 10.0.26100 | win-x64 | .NET 9.0.10 | Microsoft Testing Platform v2.0.1

   Engine Mode: SourceGenerated

[✓2/x0/↓1] Troy.WebApp.UITests.dll (net9.0|x64)                                                                                                                                                          (38s)
  Create with all values for ad

In this case, the log shows how long a test took, but it does not log every second of it.

Activity

  1. Youssef1313 commented on Oct 15, 2025

    @Youssef1313
    Member

    If you run with --no-progress, does the output look better?

    Jakub Jareš (@nohwnd) I do believe that in CI scenarios or non-capable terminals, we should default to --no-progress. I also found the current way of output very annoying.

  2. added
    area/mtp
    area/terminal-reporter
    and removed
    needs/triage
    on Oct 15, 2025
  3. HakamFostok commented on Oct 15, 2025

    @HakamFostok
    Author

    Youssef Fahmy (@Youssef1313)

    Yes, I can confirm, with --no-progress option provided, the progress reporting has been removed completely.
    But to be honest, I would like to see the progress, and when I use the TUnit library alone with a simple one test, it shows the progress and updates it instead of adding a log for each second.

    With the option above, the terminal seems not to be doing anything, and some of my tests take 3 minutes (they are Playwright tests)
    So I would like to see the progress, but just one line for it, with time being updated every second.

  4. nohwnd commented on Oct 16, 2025

    @nohwnd
    Member

    Where exactly do you see the behavior? Is that in CI or locally? What terminal is that? There are multiple modes to the reporter.

    Interactive in a session where we have Ansi codes, and so we know we can rewrite the content. That tries to write to just 1 line and update it.

    Then we have mode that is meant for CI where we know that we cannot backtrack, so we write summary of every dll about every 3 seconds.

    And then there is no-progress, which writes no progress at all.

  5. HakamFostok commented on Oct 21, 2025

    @HakamFostok
    Author

    I see this behavior locally in the Terminal of Visual Studio.
    I did not try that in CI.

    With the 'no-progress' option, it is working, and no progress at all is reported.

  6. Youssef1313 commented on Jan 16, 2026

    @Youssef1313
    Member

    Hakan Fıstık (@HakamFostok) Can you please attach a project that reproduces the problem?

  7. FlukeFan commented on Jan 16, 2026

    @FlukeFan

    Looks like is reproduced minimally here: #7240

    I hadn't connected these issues until now, but I thought that test update output was only generated on the console.

  8. nohwnd commented on Jan 20, 2026

    @nohwnd
    Member

    There are 2 general modes for the progress output, one for local commandline that is capable of moving cursor, where we use ANSI codes to jump around on the screen and update the text as needed. And other where we don't move around the screen (we might still be using ansi to color the output).

    The non moving output is output every 3 seconds, showing the progress of all projects that are running over and over, so you can track them over time.

    We can output just summary (currently done via the --no-progress switch).

  9. added a commit that references this issue on May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/mtparea/terminal-reporter

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions