Skip to content

StopUpdate in Finally Block - #4147

Merged
Marco Rossignoli (MarcoRossignoli) merged 2 commits into
microsoft:mainfrom
thomhurst:feature/is-batching-exception
Nov 25, 2024
Merged

Marco Rossignoli (MarcoRossignoli) merged 2 commits into
microsoft:mainfrom
thomhurst:feature/is-batching-exception

Conversation

@thomhurst

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Jakub Jareš (@nohwnd) can you take a look?

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