Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39415

Xvfb in a parallel pipeline doesn't use the executor number as display name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: xvfb-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.28
      Xvfb plugin 1.1.3
    • Similar Issues:

      Description

      Using the following example pipeline

      stage('stage_1') {
        parallel (
          's_1_1': {
            node() {
              wrap([$class: 'Xvfb']) {
                  sh 'sleep 10'
              }
            }
          },
          's_1_2': {
            node() {
              wrap([$class: 'Xvfb']) {
                  sh 'sleep 10'
              }
            }
          }
        )
      }
      

      the Xvfb binary is always invoked with ":0" as screen name, even if the documentation suggests the screen name should match the executor number + offset.
      Manually specifying displayNameOffset has no effect.

      The only way to make it work in parallel is by setting autoDisplayName, but we've experienced random failures with that option too. It would be great for the default behavior to allow parallel jobs without any manual configuration.

        Attachments

          Activity

          Hide
          giannello Giuseppe Iannello added a comment -

          Creating a freestyle job, enabling Xvfb with default options and triggering two concurrent runs of the job has the expected behavior - the screen name matches the executor number.

          Show
          giannello Giuseppe Iannello added a comment - Creating a freestyle job, enabling Xvfb with default options and triggering two concurrent runs of the job has the expected behavior - the screen name matches the executor number.
          Hide
          gareth_western Gareth Western added a comment -

          The plugin has an option to determine the display name automatically, as of 1.0.9:

          New feature in version 1.0.9 - auto display name (on newer Xvfb versions)
          Use Let Xvfb choose display name option with Xvfb that supports displayfd option to choose the display number automatically by Xvfb.

          How can we enable this in a pipeline script?

          Show
          gareth_western Gareth Western added a comment - The plugin has an option to determine the display name automatically, as of 1.0.9: New feature in version 1.0.9 - auto display name (on newer Xvfb versions) Use Let Xvfb choose display name option with Xvfb that supports displayfd option to choose the display number automatically by Xvfb. How can we enable this in a pipeline script?
          Hide
          zregvart zregvart added a comment -

          Gareth Western in wrap step you can place any parameters supported by the plugin, like:

          wrap([$class: 'Xvfb', autoDisplayName: true]) {
          //...
          }
          

          For auto display name make sure that your Xvfb installation supports -displayfd command line option.

          Show
          zregvart zregvart added a comment - Gareth Western in wrap step you can place any parameters supported by the plugin, like: wrap([$class: 'Xvfb' , autoDisplayName: true ]) { //... } For auto display name make sure that your Xvfb installation supports -displayfd command line option.
          Hide
          gareth_western Gareth Western added a comment -

          Thanks zregvart! I missed the part where Giuseppe says he already tried that option but experienced "random failures". I guess it would be interesting to know more about those failures. If we experience the same then I will create a separate issue.

          Show
          gareth_western Gareth Western added a comment - Thanks zregvart ! I missed the part where Giuseppe says he already tried that option but experienced "random failures". I guess it would be interesting to know more about those failures. If we experience the same then I will create a separate issue.
          Hide
          giuseppeiannello Giuseppe Iannello added a comment -

          We managed to track down those random failures to the plugin timing out waiting for Xvfb to return a display number. Increasing the timeout with 'autoDisplayName': true, 'timeout': 15 solves the problem, but slows down the builds - as far as I understood, that's not really a timeout, but more like a wait time before checking the output of Xvfb for the display number.

          Show
          giuseppeiannello Giuseppe Iannello added a comment - We managed to track down those random failures to the plugin timing out waiting for Xvfb to return a display number. Increasing the timeout with 'autoDisplayName': true, 'timeout': 15 solves the problem, but slows down the builds - as far as I understood, that's not really a timeout , but more like a wait time before checking the output of Xvfb for the display number.

            People

            Assignee:
            zregvart zregvart
            Reporter:
            giannello Giuseppe Iannello
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: