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

System.InvalidOperationException: Console is already in batching mode #4146

Open
thomhurst opened this issue Nov 25, 2024 · 7 comments
Open
Labels
Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Needs: Attention 👋

Comments

@thomhurst
Copy link
Contributor

I'm getting this on my pipelines on GitHub actions sometimes:

  Error: Unhandled exception. System.InvalidOperationException: Console is already
  in batching mode.
     at 
  Microsoft.Testing.Platform.OutputDevice.Terminal.NonAnsiTerminal.StartUpdate() 
  in 
  /_/src/Platform/Microsoft.Testing.Platform/OutputDevice/Terminal/NonAnsiTerminal
  .cs:line 125
     at 
  Microsoft.Testing.Platform.OutputDevice.Terminal.TestProgressStateAwareTerminal.
  ThreadProc() in 
  /_/src/Platform/Microsoft.Testing.Platform/OutputDevice/Terminal/TestProgressSta
  teAwareTerminal.cs:line 45
     at System.Threading.Thread.StartCallback()

Looking at the code, every call to StartUpdate is within a lock statement so that all looks correct, so the only thing I can think of is we're hitting some exception (although I can't see anything in the output - Maybe I need to tweak my verbosity?) and therefore not calling StopUpdate?

It should probably be in a finally block to ensure it's always called.

This was referenced Nov 25, 2024
@Evangelink Evangelink added Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library and removed Needs: Triage 🔍 labels Nov 25, 2024
@Youssef1313
Copy link
Member

@thomhurst Is that fixed by #4147?

@thomhurst
Copy link
Contributor Author

Hopefully !

@Youssef1313
Copy link
Member

Let us know please once you're able to confirm.

@thomhurst
Copy link
Contributor Author

When's the next package release?

@Youssef1313
Copy link
Member

Youssef1313 commented Nov 26, 2024

On NuGet.org, that would be a question for @Evangelink.

For a nightly/dogfood build, you can use this feed: https://dnceng.pkgs.visualstudio.com/public/_packaging/test-tools/nuget/v3/index.json

The version 3.7.0-preview.24575.7 includes your change (I wouldn't use that version for production, but you can just do a quick test with it in a draft PR in your repo to see if the issue is fixed).

@nohwnd
Copy link
Member

nohwnd commented Nov 26, 2024

@Youssef1313 idk if you are aware of it, but here is a full guide to the preview releases: https://aka.ms/mstest/preview

@thomhurst
Copy link
Contributor Author

Looks like I'm not getting that exception on the latest now, but I've got a new regex exception: #4159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Needs: Attention 👋
Projects
None yet
Development

No branches or pull requests

4 participants