Jenkins Console Output not flushing line-by-line, although script flushes in local console

1.4k views Asked by At

I am using Jenkins with Perl TAP::Harness::JUnit with multimple testscripts. I can't get Jenkins to flush to console before one testscript is finished. It just buffers the whole test suite and flushes it all at once when it's done. I get instances like:

  • 11:56:19 1..2
  • 11:56:19 ok 1 - Test1
  • 11:56:19 Actual time: 11:55:59 : Now sleeping for 20 seconds...
  • 11:56:19 Actual time: 11:56:19
  • 11:56:19 ok 2 - Test2

I've spent two weeks on this and I'm aware of all the normal solutions, but none of them seem to work. I have set merge => 1 in my perl TAP::Harness::JUnit and I know that intertwines STDOUT with STDERR, but I've tried all manners of flushing and nothing works on the Jenkins Console Output.

Mind you, if I try the same harness in my machine's command line, everything flushes instantly. I have tried stdbuf -i0 -o0 -e0, stdbuf -oL -eL, $|=1, autoflush STDOUT 1, printing to file CMD 1>console.log 2>&1. Nothing works

This is annoying when doing performance metrics, because I can't correlate high pressure on the CPU at such-and-such time with timestamps on particular tests, because the timestamps are meaningless. The most annoying implication, however, is that when the test hangs or crashes in the middle of the testscript, no output is printed, so I can't know why the test crashed.

0

There are 0 answers