You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "David J. Biesack" <Da...@sas.com> on 2011/10/12 15:39:06 UTC

surefire forked processes not killed after timeout

Our forked JUnit/surefire processes are not stopping correctly when timing out
within a Maven build (running inside our Jenkins CI server). The maven build
finishes and in Jenkins shows a failed/unstable build. These running processes
cause problems later, because the tests may be holding a resource like a port,
and subsequent rebuilds fail because the tests fail.

For example, even though no Maven builds are currently running, ps shows about a
dozen Java processes running, with commands such as:

/usr/local/java-1.6_23/jre/bin/java -Xms1g -Xmx5g -Djava.library.path=/u/jenkinsci/.hudson/jobs/rtolap.jtt.tests/workspace/target/lib \
   -jar /u/jenkinsci/.hudson/jobs/rtolap.jtt.tests/workspace/target/surefire/surefirebooter1374560535780866887.jar \
   /u/jenkinsci/.hudson/jobs/rtolap.jtt.tests/workspace/target/surefire/surefire65313...
/usr/local/java-1.6_23/jre/bin/java -Xmx2g -Xms1g -Djava.library.path=/u/jenkinsci/.hudson/jobs/rtolap/workspace/target/lib \
   -jar /u/jenkinsci/.hudson/jobs/rtolap/workspace/target/surefire/surefirebooter6814971258434039335.jar \
   /u/jenkinsci/.hudson/jobs/rtolap/workspace/target/surefire/surefire5806103969370259371tmp /u/jenkinsci/...
...

We have our Maven surefire preferences set to fork the tests (via a parent pom)

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <forkMode>once</forkMode>
                    <forkedProcessTimeoutInSeconds>720</forkedProcessTimeoutInSeconds>
                </configuration>
            </plugin>

I suspect the timeout is the problem - i.e. perhaps the test is timing out and
the attempt to kill the forked process fails, leaving it running.

Has anyone seen something similar and/or know how to fix this so that surefire
*really* kills the process?

When this happens, doing

  kill <processid>

(logged in as the process owner) usually does not work, but

  kill -9 <processid>

does.

(I filed under SUREFIRE-773 bug http://jira.codehaus.org/browse/SUREFIRE-773 but
am hoping someone on the list may know a solution.)

thanks,
djb

-- 
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com    (919) 531-7771


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org