The /console and /consoleText logs for a job using
<hudson.tasks.Shell> <command>set +x echo -n Sleeping; for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do echo -n .; sleep 1; done; echo</command> </hudson.tasks.Shell>
do not show progress until the very end, even though the log on disk gets updated every second.
Note that
@Test public void subLineProgress() throws Exception { ByteBuffer buf = new ByteBuffer(); LargeText text = new LargeText(buf, false); buf.write("Started.\n".getBytes()); StringWriter w = new StringWriter(); text.writeLogTo(0, w); assertEquals("Started.\n", w.toString()); buf.write("Running...".getBytes()); w = new StringWriter(); text.writeLogTo(0, w); assertEquals("Started.\nRunning...", w.toString()); buf.write("done.\n".getBytes()); w = new StringWriter(); text.writeLogTo(0, w); assertEquals("Started.\nRunning...done.\n", w.toString()); }
fails, but according to the Javadoc this seems to be intentional. A fix would probably need a coordinated fix in Stapler, though AnnotatedLargeText may also contribute to the problem.
- relates to
-
JENKINS-38381 [JEP-210] Optimize log handling in Pipeline and Durable Task
- Resolved