Daniel Wood wrote:
> FYI, I saw some comments and adding fflush's into isolationtester.c.
> I ran into the same problem with debugging tests when they
> failed/hung in the middle. A simple "setbuf(stdout, NULL)" at the
> beginning of main gets rid of the problem where line buffering
> becomes block buffering when redirecting stdout to a file. This
> causes problems with sequencing of mixed stderr and stdout and not
> seeing the last few lines of stdout if the process fails or hangs.
> The setbuf on stdout shown above disables buffering of stdout to
> match the unbuffered stderr.
FWIW it took me a long time but I eventually realized the wisdom in your
suggestion. I have applied this to the master branch.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services