-
Bug
-
Resolution: Fixed
-
Minor
-
None
The docs say displayName is "(default) choosen by random"
The code comments on the variable say "DISPLAY name, if NULL chosen by random."
The actual contents of src/main/java/org/jenkinsci/plugins/xvfb/XvfbBuildWrapper.java L470 say that it will always use executor.getNumber() + displayNameOffset - which always returns displayNameOffset (default 1).
As a result, DISPLAY is always 1.
Using autoDisplayName is not an option, because it requires a version of Xvfb far too new for our builders (1.14 I think?)
Yes, "random" is a poor choice of word, "based on current build executor" would be better wording. The idea that drives the display number to be based on build executor number is that display names generated based on build executors would bring greater stability to the build than display numbers that are purely random.
If you can't use the "Let Xvfb choose display name" option, I suggest that you reserve a port range that and use that as "Xvfb display name offset".
Randomized display names would require some kind of collision detection which would bring (IMHO) unneeded complexity to the Xvfb Jenkins wrapper.