0

I need to run two jenkins' job in parallel but when first one is running the second one fails stating that Server is already active for display 0

I have gone through these two posts but not able to fix:

  1. Xvfb plugin to run multiple job instances concurrently on Jenkins
  2. https://www.blazemeter.com/blog/headless-execution-selenium-tests-jenkins

I have export DISPLAY=:99 this line added in my centos 7 profile.

Also I have below configuration for XVFB in jenkins >

1. Manage jenkins > Configure System (Configure global settings and paths.) enter image description here 2. And then in Job configuration I have: enter image description here enter image description here

Please let me know if I am missing anything. Thanks

paul
  • 4,333
  • 16
  • 71
  • 144

1 Answers1

1

Please check the option "Let Xvfb choose display name" and Xvfb display name offset=1 in Build Environment of your Job's configuration to leave the choice of display number to Xvfb.

Once you check the checkbox, Jenkins uses the -displayfd option of Xvfb by which it chooses it’s own display name by scanning for an available one. It needs to be checked if you do not want to manage display number ranges but have the first free display number be used.

Xvfb display name offset lets you specify a offset i.e. a number that will be added to the job's executor number that will form the display name used. This is handy if you run other X servers (Xvfb, Xvnc or similar) in order to ensure that display numbers do not overlap.

This option requires a recent version of xserver, check your installation for support. I have used Xvfb plugin 1.1.3 in my project and it's working fine for me.

Atul KS
  • 908
  • 11
  • 21