cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
182 stars 27 forks source link

Implement Jenkins#consoleStream #11

Closed 5long closed 11 years ago

5long commented 11 years ago

This branch is just #10 and:

cliffano commented 11 years ago

Looks good at a glance. I'm going to test it against my common usage scenarios first.

cliffano commented 11 years ago

Thanks for the contribution Whyme. This change has been included in v0.1.2 .

cliffano commented 11 years ago

Hmm, I just tested the new console handling a bit more and I noticed that it no longer behaves as it was originally designed.

The intention was to simulate console output display on the terminal the same way as the console output is displayed on Jenkins web, i.e. it should progress along the build.

5long commented 11 years ago

I'm using nestor console to monitor our deploy job and it works as intended. A moment before I've tested nestor console with a lengthy frontend assets compiling job and it works too. By "it works" I mean nestor console and <jenkins url>/job/<job name>/<job id>/console are printing output as the same pace.

What is the pattern of your job output? Is it a dot matrix of unit test result which doesn't print any \n for a long time? I'm suspecting that the stdout of node is buffered line-wise but I'm not quite sure.

I'll do more testing against more jobs and see if I can reproduce it.

Also, I'm running nodejs 0.8.22, nestor 0.1.3 and Jenkins 1.480.3 LTS.

5long commented 11 years ago

Well it turns out that I guessed wrong. process.stdout.write is synced by default when stdout is TTY: http://nodejs.org/api/process.html#process_process_stdout

cliffano commented 11 years ago

Weird, I can't reproduce the problem now. What I saw was tty console output being written without new lines and at a different pace compared to web console output. I used node v0.10.1 .

Don't worry about it. I'll do more testing, but I think it was a false alarm.

Thanks for the confirmation.