Skip to content

[WIP] Fix CI job failure in GitHub Actions for E4Application#38

Merged
peterkir merged 2 commits intomainfrom
copilot/fix-ci-job-failure
Apr 3, 2026
Merged

[WIP] Fix CI job failure in GitHub Actions for E4Application#38
peterkir merged 2 commits intomainfrom
copilot/fix-ci-job-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

  • Review failing CI job and workflow file
  • Install xvfb and wrap ./build.sh --jar-signing with xvfb-run -a -s "-screen 0 1920x1080x24" in the build step
  • Add Collect Eclipse runtime metadata step (if: always()) to tar .metadata dir
  • Add Upload Eclipse runtime logs artifact step (if: always()) using pinned SHA action version
Original prompt

Create a PR to fix CI job failure in GitHub Actions run https://github.com/klibio/example.pde.rcp/actions/runs/23947290471/job/69846604690?pr=37.

Failure context:

  • Tycho UI integration test module tests/example.rcp.tests.it fails to launch E4Application on ubuntu-latest (tycho-surefire-plugin 5.0.2 returns error code 13).
  • Job log indicates: "Launching application org.eclipse.e4.ui.workbench.swt.E4Application" then "An error has occurred. See the log file .../tests/example.rcp.tests.it/target/work/data/.metadata/.log".

Required changes:

  1. Update workflow .github/workflows/10_build-validation.yml to run the existing build step (./build.sh --jar-signing) under Xvfb on Linux CI. Ensure xvfb is installed (apt-get) and use xvfb-run -a -s "-screen 0 1920x1080x24".
  2. Add steps to always collect and upload the Eclipse runtime metadata/logs from tests/example.rcp.tests.it/target/work/data/.metadata as a build artifact (e.g., tar.gz) with if: always() so the .metadata/.log is available even on failure.
  3. Keep existing workflow behavior intact (existing JAVA_HOME exports, validation, and artifact uploads). Make minimal changes: wrap the existing build invocation rather than rewriting workflow.

Acceptance criteria:

  • Workflow continues to run on push/pull_request.
  • UI tests can start in CI due to virtual display.
  • Artifact named like eclipse-runtime-logs is uploaded (warn if missing).
  • YAML remains valid and uses the existing upload-artifact pinned action version where possible.

Reference file versions previously inspected (for context only): .github/workflows/10_build-validation.yml at commit a20d4c7.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failing job is dying while Tycho tries to launch the UI test runtime for tests/example.rcp.tests.it:

  • It launches org.eclipse.e4.ui.workbench.swt.E4Application
  • Immediately prints: An error has occurred. See the log file .../.metadata/.log
  • Tycho then reports: unexpected error ... (process returned error code 13) for example.rcp.tests.it (Tycho Surefire 5.0.2)

That pattern almost always means: the SWT/Eclipse UI cannot start on the Linux CI runner because there is no display server (X11/Wayland) (or required GTK libs), so the application exits very early and Tycho just sees a non-zero exit code.

Solution (recommended): run UI tests under Xvfb on Linux CI

Wrap the build/test execution in a virtual X server so SWT can create a display.

Change .github/workflows/10_build-validation.yml (ref a20d4c7b6d4db84cfbbcde524e8ee45cbb1a4b1f)

Update the build step to run build.sh under xvfb-run:

- name: build
  shell: bash
  run: |
    echo -e "#\n# build\n#\n"
    echo "# configure environment for maven/tycho calls"
    export JAVA_HOME_8=$JAVA_HOME_8_X64
    export JAVA_HOME_11=$JAVA_HOME_11_X64
    export JAVA_HOME_17=$JAVA_HOME_17_X64
    export JAVA_HOME_21=$JAVA_HOME_21_X64
    export JAVA_HOME_25=$JAVA_HOME_25_X64

    export PATH=$JAVA_HOME/bin:$PATH

    # Ensure Xvfb is present (usually is on ubuntu-latest, but install to be safe)
    sudo apt-get update
    sudo apt-get install -y xvfb

    # Run UI-based Tycho tests with a virtual display
    xvfb-run -a -s "-screen 0 1920x1080x24" ./build.sh --jar-signing

Why this fixes it:

  • Your IT test module explicitly enables the UI harness:
    • tests/example.rcp.tests.it/pom.xml sets <useUIHarness>true</useUIHarness> and launches E4Application.
  • On ubuntu-latest there’s no GUI session, so SWT will fail unless you provide a display (Xvfb).

Optional hardening (helps stability on CI)

If UI startup is still flaky, add these JVM args to the Tycho surefire configuration in tests/example.rcp.tests.it/pom.xml (ref a20d4c7b6d4db84cfbbcde524e8ee45cbb1a4b1f):

<configuration>
  <skipTests>${skip.ui-tests}</skipTests>
  <useUIHarness>true</useUIHarness>
  <useUIThread>false</useUIThread>
  <product>example.rcp.app.ui.product</product>
  <application>org.eclipse.e4.ui.workbench.swt.E4Application</application>

  <argLine>
    -Djava.awt.headless=false
    -Dosgi.instance.area.default=@user.home/work
  </argLine>
</configuration>

But in most cases, Xvfb alone is the key missing piece.

Quick note on the log hint

The job output points to the real Eclipse error details in:
tests/example.rcp.tests.it/target/work/data/.metadata/.log

If you also upload that .metadata/.log file as an artifact when tests fail, future debugging becomes much faster—but the primary fix here is to provide an X display via Xvfb so the UI runtime can start at all.

User: do both uploading and xvfb fix

Assistant: I’m currently waiting for ...

This pull request was created from Copilot chat.

Copilot AI requested a review from peterkir April 3, 2026 14:26
@peterkir peterkir marked this pull request as ready for review April 3, 2026 14:27
@peterkir peterkir merged commit 0abf937 into main Apr 3, 2026
3 checks passed
@peterkir peterkir deleted the copilot/fix-ci-job-failure branch April 3, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants