You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ConsoleReporter ingredient uses NoBuffering mode when outputting test results. While it works fine on Linux, there's is noticeable slowdown when printing results of test run on Windows in cmd.exe, it's derivatives like msys and cygwin consoles. The visual effect is that output is being produced character-by-character and tests that took about 10 seconds with test-framework now take 30+ seconds to complete.
The problem is reproducible on both Windows XP and Windows 7 versions with 2014 Haskell Platform, and on a variety of terminal emulators.
The offending code is from core/Test/Tasty/Ingredients/ConsoleReporter.hs:
--| A simple console UIconsoleTestReporter::Ingredient
consoleTestReporter =...
(\k ->if isTerm
then (do hideCursor; k) `finally` showCursor
else k) $do
hSetBuffering stdout NoBuffering
So, is there a reason to use no buffering instead of line buffering?
The text was updated successfully, but these errors were encountered:
Yes, the reason is so that the user sees which test is currently running. Otherwise, the test's name wouldn't appear until it's complete, which may be annoying for long-running tests.
I wonder if keeping the output buffered and calling hFlush explicitly would fix the problem. Can you try that?
Hi, sorry for long delay for such a trivial thing, but I finally managed to try it out and can confirm that adding hFlush maintains desired behavior when using line buffering on Windows.
The ConsoleReporter ingredient uses NoBuffering mode when outputting test results. While it works fine on Linux, there's is noticeable slowdown when printing results of test run on Windows in cmd.exe, it's derivatives like msys and cygwin consoles. The visual effect is that output is being produced character-by-character and tests that took about 10 seconds with test-framework now take 30+ seconds to complete.
The problem is reproducible on both Windows XP and Windows 7 versions with 2014 Haskell Platform, and on a variety of terminal emulators.
The offending code is from
core/Test/Tasty/Ingredients/ConsoleReporter.hs
:So, is there a reason to use no buffering instead of line buffering?
The text was updated successfully, but these errors were encountered: