[Git][ghc/ghc][wip/sjakobi/T12934-line-buffer-stdout] testsuite: Line-buffer the driver's stdout
Simon Jakobi pushed to branch wip/sjakobi/T12934-line-buffer-stdout at Glasgow Haskell Compiler / GHC Commits: cd91c746 by Simon Jakobi at 2026-08-28T20:26:37+02:00 testsuite: Line-buffer the driver's stdout The driver prints a progress line every ~100 tests, but when stdout is a pipe — as under hadrian and in CI — Python block-buffers it at 8 KiB, which is more than a clean run's entire progress output. So CI logs would show no sign of life until the run ended. The type-ignore is for mypy, which types sys.stdout as TextIO — an interface without reconfigure. Fixes #12934. Assisted-by: Claude Fable 5 - - - - - 1 changed file: - testsuite/driver/runtests.py Changes: ===================================== testsuite/driver/runtests.py ===================================== @@ -38,6 +38,10 @@ import term_color from term_color import Color, colored import cpu_features +# Line-buffer stdout: when it is a pipe (hadrian, CI), the block-buffered +# default can delay all progress output until the run ends (#12934). +sys.stdout.reconfigure(line_buffering=True) # type: ignore[union-attr] + # Readline sometimes spews out ANSI escapes for some values of TERM, # which result in test failures. Thus set TERM to a nice, simple, safe # value. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd91c746e4e6c7ccbd2a3cdda49f056c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd91c746e4e6c7ccbd2a3cdda49f056c... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Jakobi (@sjakobi)