Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remaining issue where VRT test fails in CI when launching Chromium #9406

Closed
4 tasks
techanvil opened this issue Sep 24, 2024 · 3 comments
Closed
4 tasks
Labels
P0 High priority QA: Eng Requires specialized QA by an engineer Team M Issues for Squad 2 Type: Bug Something isn't working Type: Infrastructure Engineering infrastructure & tooling

Comments

@techanvil
Copy link
Collaborator

techanvil commented Sep 24, 2024

Bug Description

The fix applied via #9211 has improved the reliability of our VRT workflow, however it is still failing with some regularity with the following error:

      COMMAND | Command "test" ended with an error after [679.315s]
      COMMAND | Error: Failed to launch the browser process!

It does however look like a potentially different permutation of the error - in the example occurrences it's surrounded by "Unmatched GET" log messages which were not evident in previous iterations.

Steps to reproduce

Screenshots

image

Additional Context

See the Additional Context section on #9211 for some relevant avenues that remain to be explored for the fix.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • VRT test runs should not fail with an error before all the screenshots are captured and the test has run to completion.

Note, additional issues should be raised if needed to follow up on separate avenues of investigation.

Implementation Brief

This IB is based on debug work in the PR #9412.

  • Update docker/backstopjs/Dockerfile to install chromium and it's requirements in a separate step and pass the PUPPETEER_EXECUTABLE_PATH constant like so:

    RUN apk add --no-cache \
    chromium \
    nss \
    freetype \
    harfbuzz \
    ca-certificates \
    ttf-freefont \
    nodejs \
    npm \
    openrc \
    dbus
    ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
    RUN apk upgrade --no-cache --available && \
    PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i -g backstopjs@${BACKSTOPJS_VERSION} && \
    npm cache clean -f && \
    rm -rf /root/.cache && \
    rc-update add dbus

    Why? This was based on notes in puppeteers troubleshooting docs. Alpine is not officially supported by chromium, so installing the required packages along with the install is vital.

  • This new version of chromium will render many components slightly differently, so you need to run and update the VRT images once. After this is done future VRT runs will pass consistently (eg.).

  • Also this change highlights some new failing tests:

  • AudienceSegmentation_Dashboard_AudienceSelectionPanel_Audience_creation_notice and Views/WPDashboardApp/WPDashboardWidgets/ReadyWithActivateAnalyticsCTA for unknown reasons:

    • Add a delay of 1500ms to the Modules/Analytics4/Components/AudienceSegmentation/Dashboard/AudienceSelectionPanel/AudienceCreationNoticeOneAdded story allows this test to pass reliably.
    • Increase the delay to 6000ms for the Views/WPDashboardApp/WPDashboardWidgets/ReadyWithActivateAnalyticsCTA story.
  • AdSense_Module_Overview_Widget which was another case of the DataBlockGroup component causing issues (just like Fix flaky VRT tests #9101)

Test Coverage

  • Approve any changes to VRT images based on the chromium version change. They will compare consistently from now on.

QA Brief

  • View the VRTs Visual Regression Testing / Run VR Tests check on this ticket and confirm it complete successfully.

Changelog entry

  • Fix VRT test failures in CI when launching Chromium, ensuring tests run to completion without errors.
@techanvil techanvil added P0 High priority Type: Bug Something isn't working Type: Infrastructure Engineering infrastructure & tooling labels Sep 24, 2024
@benbowler benbowler self-assigned this Sep 25, 2024
@benbowler benbowler removed their assignment Sep 26, 2024
@aaemnnosttv aaemnnosttv self-assigned this Sep 26, 2024
@aaemnnosttv
Copy link
Collaborator

IB ✅ !

@aaemnnosttv aaemnnosttv assigned benbowler and unassigned aaemnnosttv Sep 26, 2024
@ivonac4 ivonac4 added the Team M Issues for Squad 2 label Sep 27, 2024
@benbowler benbowler assigned benbowler and unassigned benbowler Sep 30, 2024
@hussain-t hussain-t self-assigned this Oct 1, 2024
@benbowler
Copy link
Collaborator

Adding a note here from chatting to @hussain-t about the CR of this ticket. I marked it blocked by #9101 (which is with @tofumatt as of 1 hour ago) because the VRTs listed in that ticket will fail here until fixed there. We should merge that ticket ASAP then continue to review this ticket and merge ASAP because every new test added before we merge this ticket requires the VRTs to be re-run for this PR. That's because the update version of Chromium renders most components slightly differently so any previously captured images are invalid.

@hussain-t hussain-t removed their assignment Oct 7, 2024
@wpdarren wpdarren added the QA: Eng Requires specialized QA by an engineer label Oct 11, 2024
@techanvil techanvil self-assigned this Oct 11, 2024
@techanvil
Copy link
Collaborator Author

QA ✅

Confirmed the VRT tests passed in the test run for the PR:

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority QA: Eng Requires specialized QA by an engineer Team M Issues for Squad 2 Type: Bug Something isn't working Type: Infrastructure Engineering infrastructure & tooling
Projects
None yet
Development

No branches or pull requests

7 participants