[squeak-dev] Jenkins update; shell scripting question

Chris Cunnington smalltalktelevision at gmail.com
Thu Apr 26 18:27:29 UTC 2012

Hi All,

The Jenkins server is almost there. It produces xml files and presents 
them with the Emma plugin. For the image, Lukas's code works almost 
extant. I did have to comment out a class called Author, which we don't 

We get xml files. And Jenkins presents them with all the precision and 
accuracy that Lukas created them with. So far so good. But there's a 
wrinkle I need help with.

Starting the build is one thing. Stopping it - and stopping it at the 
right time - is quite another. Left on its own, Jenkins will shut things 
down after ~8 seconds. To do ~3000 tests in ~70 xml files takes ~90 

Lukas has two pieces of code that address this ... or, don't. I'm not 
sure if both are necessary or if one of them is just for logging 
purposes. My interest in logging is up there with tests, so I need to 
get this right.

Naturally, there is one in the image and, another in the shell script.

For the image, you load in a script on startup of all the tests you want 
to run. You add #snapshot:andQuit: at the end of that script.

But in the build.sh script there is this:

if [ $! ] ; then
     while kill -0 $! 2> /dev/null ; do

I think this is saying: "If there is a process running in the 
background; while the last process running in the background cannot 
receive a signal, do the following..."

So I have two questions:

1.) Why would a process not be able to receive a signal?
2.) And if it couldn't, then what would that tell me.

After I can figure out this last item, then I should be able to open up 
the squeakci.org site next week.


# wait for the process to terminate, or a debug log
if [ $! ] ; then
     while kill -0 $! 2> /dev/null ; do
         if [ -f "$OUTPUT_DUMP" ] || [ -f "$OUTPUT_DEBUG" ] ; then
             sleep 5
             kill -s SIGKILL $! 2> /dev/null
             if [ -f "$OUTPUT_DUMP" ] ; then
                 echo "$(basename $0): VM aborted ($PHARO_VM)"
                 cat "$OUTPUT_DUMP" | tr '\r' '\n' | sed 's/^/  /'
             elif [ -f "$OUTPUT_DEBUG" ] ; then
                 echo "$(basename $0): Execution aborted ($PHARO_VM)"
                 cat "$OUTPUT_DEBUG" | tr '\r' '\n' | sed 's/^/  /'
             exit 1
         sleep 1
     echo "$(basename $0): unable to start VM ($PHARO_VM)"
     exit 1

More information about the Squeak-dev mailing list