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

StopUpdate in Finally Block #4147

Merged

Conversation

thomhurst
Copy link
Contributor

#4146

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.

@MarcoRossignoli
Copy link
Contributor

@nohwnd can you take a look?

@MarcoRossignoli MarcoRossignoli enabled auto-merge (squash) November 25, 2024 16:42
@MarcoRossignoli MarcoRossignoli merged commit 7d0cd29 into microsoft:main Nov 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants