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 no node with give id found selenium error #16860

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

danidoni
Copy link
Contributor

We've been hit by the following error in our CI pipeline

 Selenium::WebDriver::Error::UnknownError:
   unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
     (Session info: chrome=128.0.6613.119)

(See an example here)

This PR upgrades selenium-webdriver and tweaks it's configuration to be able to use a specific Chromedriver version (one that is known to not be affected by that error).

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Sep 18, 2024
@danidoni danidoni force-pushed the fix-no-node-with-give-id-found-selenium-error branch from 8ed6244 to 96b83be Compare September 18, 2024 12:30
@@ -22,6 +22,9 @@ ADD Gemfile /obs/src/api/Gemfile
ADD Gemfile.lock /obs/src/api/Gemfile.lock
RUN chown -R frontend /obs/src/api

# Remove chromedriver binary to allow selenium-manager manage versions
RUN rm -rf /usr/bin/chromedriver
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a temporary hack. The proper way to do it is to remove chromedriver from the docker image we use in the CI pipeline, or just use frontend-base (that does not have chromedriver installed) instead of frontend-features as docker image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please just make sure that this temporary hack is recorded in a card, so we can follow up and do it properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please just make sure that this temporary hack is recorded in a card, so we can follow up and do it properly.

https://trello.com/c/IYwr5IsM/194-remove-frontend-features-container

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said before elsewhere, this does not change anything in CI...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

@github-actions github-actions bot added the Test Suite / CI 💉 Things related to our tests/CI label Sep 19, 2024
@danidoni danidoni force-pushed the fix-no-node-with-give-id-found-selenium-error branch from a13ae00 to 96b83be Compare September 19, 2024 08:18
When running feature specs some errors pop up:

  1.3) Failure/Error: Unable to infer file and line number from backtrace

    Selenium::WebDriver::Error::InvalidSessionIdError:
      invalid session id

Disabling the use of shared memory seems to fix those errors.
selenium-webdriver brings support to use Chrome for testing (CfT) via selenium-manager.

CfT does not auto-updates itself and allows us to set a specific
chrome (&chromedriver) version.

See https://www.selenium.dev/blog/2023/selenium-4-11-0-released/
selenium-manager is a tool introduced by selenium-webdriver to use
specific browser versions.

Chromedriver version 119 seems to not be affected by the error regarding
'No node with given id found'.

See https://issues.chromium.org/issues/42323468#comment95
selenium-manager is used to allow the use of specific chrome browser and
chromedriver versions.

Unfortunately, if the chromedriver binary is present, selenium-manager
detects that and then uses that chromedriver version (128) with the
downloaded browser version (119), and the spec suite fails with the
following error:

    Selenium::WebDriver::Error::SessionNotCreatedError:
        session not created: This version of ChromeDriver only supports Chrome version 128
        Current browser version is 114.0.5735.133 with binary path /home/frontend/.cache/selenium/chrome/linux64/114.0.5735.133/chrome

See https://www.selenium.dev/blog/2023/whats-new-in-selenium-manager-with-selenium-4.11.0/#drivers-on-the-path
@danidoni danidoni force-pushed the fix-no-node-with-give-id-found-selenium-error branch 3 times, most recently from a0284f2 to 8d2ca80 Compare September 19, 2024 14:19
We cannot use anything that uses base64 > 0.1.1 as it is provided by
the system ruby 3.1.

This limits the version of selenium-webdriver that we can use (currently
4.16.0).
selenium-manager lives inside bin/linux, not bin, so the build script
crashed in the final steps.

This fix skips subdirectories.
@danidoni danidoni force-pushed the fix-no-node-with-give-id-found-selenium-error branch from 8d2ca80 to 182f308 Compare September 19, 2024 14:39
@danidoni danidoni marked this pull request as ready for review September 19, 2024 15:07
@hennevogel
Copy link
Member

I doubt you are fixing anything with this. In this PR you just run chromium on circle-ci on a different host, with different resources available. Just as you do if you trigger a new run of the test suite in other PRs. I mean look at the history of CI builds for this PR... https://app.circleci.com/pipelines/github/openSUSE/open-build-service?branch=pull%2F16860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants