Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4013

ShowGraphServletTest Unit test fails if DISPLAY environment variable is set and no X Windows System is running

    Details

    • Complexity:
      Low

      Description

      This test ShowGraphServletTest uses the JFreeChart library which by default uses a Graphical UI to operate.
      The test started failing when Bamboo had a DISPLAY environment variable set for Selenium tests.
      The workaround for now is to have Selenium set the DISPLAY it needs at runtime and not have the variable be global for all Bamboo jobs.
      But, for the sake of making this headless the fix can be to set the surefire plugin to use the headless JVM property.
      In in the pom.xml, use
      <systemPropertyVariables>
      <java.awt.headless>true</java.awt.headless>
      </systemPropertyVariables>

      Steps to reproduce.
      1. Set DISPLAY=:99 #This variable needs to be accessible to the user running Bamboo (e.qbamboo)
      2. Run Junit tests for core. # specifically the test mentioned above.
      3. The result of the test will contain this error message.
      "Can't connect to X11 window server using ':99' as the value of the DISPLAY variable."

      See https://ci-stg.openmrs.org/browse/TRUNK-LATEST-JOB1-56/test/case/2362046 for full error.

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  gilhooleyd David Gilhooley
                  Reporter:
                  breeze Chris Briesemeister
                  Watchers:
                  Chris Briesemeister, Daniel Kayiwa, David Gilhooley, Lisha Ruan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 30 minutes Original Estimate - 30 minutes
                    30m
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 hours
                    4h