Hi there,

On 03/05/2012 03:07 PM, MSF wrote:
we have some issues with one of our jobs on our Jenkins (1.424.3 =
current LTS Version). We are using xvnc (1.10) and Sonar (1.8) plugins.
The job fails because the generated xvnc session is terminated before
Sonar is started.

Can you maybe explain your build setup a bit further?

You have a single Jenkins job, which has "Run Xvnc" as a build environment action, you build some code (and maybe run tests), then a "Run Sonar analysis" post-build action should occur. Is that right?

I had the feeling that BuildWrappers like Xvnc only exit at the very end of a build, so it would be useful to see what your setup is. Though I haven't checked this statement :)


We tried different versions of the plugins, but the
result is always the same. We even tried to recompile the xvnc plugin
from source with a different ordinal number like:

@Extension(ordinal = 1)

public static final class DescriptorImpl extends BuildWrapperDescriptor

or:

@Extension(ordinal = 10000)

public static final class DescriptorImpl extends BuildWrapperDescriptor

but this did also change nothing in the result.

Here the ordinal only affects which BuildWrapper runs first, so it wouldn't affect the order of post-build actions like Sonar.


Here is the error with stack trace:

[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory:
/home/jenkins/.jenkins/jobs/JOBNAME-Sonar/workspace/JOBNAME/JOBMODULE-tile/target/surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException: Can't
connect to X11 window server using ':14' as the value of the DISPLAY
variable.; nested exception is java.lang.InternalError: Can't connect to
X11 window server using ':14' as the value of the DISPLAY variable.
java.lang.InternalError: Can't connect to X11 window server using ':14'
as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
...

[ERROR] There are test failures.

Why does Sonar even need a graphical environment to execute?

Perhaps it's just being opportunistic, seeing that the DISPLAY variable is set and tries to run in graphical mode. Maybe the Xvnc plugin should unset the DISPLAY variable when it shuts down?


We're out of ideas right now, but it's quite important to get this
running. Is there any way to have the xvnc plugin with a X session still
running when Sonar is executed?

A possible alternative would be to create a separate Jenkins job that just runs Sonar, and copy all the files (test result XML, and whatever) from the first job that Sonar needs to look at.

Regards,
Chris

Reply via email to