question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'dotnet test' sometimes causes terminal to stop echoing after completion (ubuntu)

See original GitHub issue

From @beevik on Saturday, December 21, 2019 7:20:52 PM

When running dotnet test on ubuntu, the terminal often stops echoing input after the command completes. It’s not 100%. Sometimes echoing remains on. I’m using the xunit testing framework.

Here are the results of typing stty -a after the terminal stops echoing:

speed 38400 baud; rows 40; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

As you can see, echo is off (-echo).

This does not appear to be a bug in xunit, as someone has reported a similar issue when using expecto instead.

Ubuntu 18.04.3 .NET Core 3.1 xunit 2.4.1

Copied from original issue: dotnet/sdk#4090

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:37
  • Comments:84 (30 by maintainers)

github_iconTop GitHub Comments

14reactions
livarcocccommented, Dec 28, 2019

From @rmunn on Monday, December 23, 2019 8:18:21 PM

I’m the one who reported that issue with Expecto. I also have a vague memory of seeing this pop up with other dotnet foo commands such as dotnet build, but I don’t have a solid example since I’m away from my desk for the holidays. Once I get a solid example I’ll mention it here.

BTW, for anyone else who experiences this, you can restore your terminal to normal functionality after this issue triggers by typing stty echo followed by Enter.

8reactions
Jodacolacommented, Mar 29, 2020

I just ran into this. Definitely annoying! After reading through this and related issues, I tried to determine minimal reproducible steps.

Environment

  • Windows 10
  • WSL with Ubuntu 18.04
  • .NET Core SDK version 3.1.100 in WSL
  • Using both the Ubuntu and the Windows Terminal application (reproduced in both)

Findings

  • I cannot reproduce when running dotnet test from within a single test application’s directory.
  • I can regularly reproduce when running dotnet test from a directory with a solution file and multiple projects (mix of test and non-test projects, all added to the .sln file).
  • When trying to debug output (via something like piping to sed, e.g. dotnet test | sed -n 'l'), I’m not seeing any immediately incriminating control characters.
  • I have, however, noticed output lines being interleaved or being outputted in different order, leading me to a hunch that there’s some manner of race condition with terminal output causing the symptoms.

Reproduction

From the command line, I narrowed everything down to being able to run the following commands to reproduce the issue fairly reliably:

mkdir TestTerminalIssues
cd TestTerminalIssues
dotnet new xunit --name Project1
dotnet new xunit --name Project2
dotnet new classlib --name Project3
dotnet new sln
dotnet sln add Project1 Project2 Project3
dotnet build
dotnet test

Run dotnet test until the terminal stops behaving as expected. It usually only takes me two or three attempts before the terminal “breaks.”

Will try to dig in further, but I hope this helps, in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

View topic - Bash regularly stops echoing to terminal
The general symptoms are that bash randomly stops echoing to the terminal, and there's no way to get the terminal to return to...
Read more >
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project. ... running when this command finishes, the download is...
Read more >
How to solve the issue that a Terminal screen is messed up ...
Sometimes, a terminal screen is messed up, and when we use man ls to read the manpages, or press the UP arrow to...
Read more >
VSCode's shell command `code` no longer working in ...
I think this issue was caused to me by an update of VSCode, which happened automatically. To solve it: open VSCode in Windows....
Read more >
The Linux command line for beginners - Tutorials
The Linux command line is a text interface to your computer. Often referred to as the shell, terminal, console, prompt or various other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found