1
votes

I have a build flow job in Jenkins that can execute concurrent builds. Each build in a single running instance of the job can run multiple UI tests, where each test set should run on a unique Xvfb port. I am using the Xvfb plugin.

Conceptually this:

Job1 and Job2 are 2 concurrent instance of a Build Flow job. There could be more.
Each of Job1 and Job2 can have concurrent running children, 
each of which is a Free Flow job that configures the Xvfb in it.

Job1 -------------| -Test set 1 (test_a, test_b etc. on Xvfb port 1) -> free flow instance 1@Job1
                  |
                  | -Test Set 2 (test_x, test_y etc. on Xvfb port 2) -> free flow instance 2@Job1
                  |
                  | -Test Set 3 (test_p, test_q etc. on Xvfb port 3) -> free flow instance 3@Job1
                  |
                  | -Test Set 4 (test_m, test_n etc. on Xvfb port 4) -> free flow instance 4@Job1

Job2 -------------| -Test set 1 (test_s, test_t etc. on Xvfb port 5) -> free flow instance 1@Job2
                  |
                  | -Test Set 2 (test_d, test_e etc. on Xvfb port 6) -> free flow instance 2@Job2
                  |
                  | -Test Set 3 (test_j, test_k etc. on Xvfb port 7) -> free flow instance 3@Job2

The Xvfb configuration is as below: Xvfb configuration in test running job

I am running into a lot of port collisions and issues where it throws errors that says:

_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
20:51:06 _XSERVTransMakeAllCOTSServerListeners: server already running

Could someone tell me how I can configure Xvfb so that each running instance of the job occupies a unique display/screen.

To simplify and summarize, say I have a simple Jenkins job that uses a Xvfb display port to run. And, the job can run as multiple instances concurrently. How is it possible to ensure that each of the concurrent instances run on a unique Xvfb display?

1

1 Answers

1
votes

A bit late to the party, but came across this question while setting up my Jenkins Xvfb jobs. The solution in my case was to add a runtime flag

xvfb-run -a

This will keep trying display ports until it finds a free one. You can read more here. So try adding the flag in the Xvfb additional options plugin field.