Skip to content

Failing Docker tests when running on M2 mac #2690

Closed
@evan1108

Description

@evan1108

I cloned the SeleniumBase repo, built the docker image docker build --platform linux/amd64 -t seleniumbase ., and ran the test docker run --platform linux/amd64 seleniumbase ./run_docker_test_in_chrome.sh I get an error saying Chrome has failed to start/crashed. I haven't made any changes to the Dockerfile. I've tried running the test without the --platform tag in the docker run command and that fails as well. Running on an M2 mac.

***** SeleniumBase Docker Machine *****
Running example SeleniumBase test from Docker with headless Chrome...
============================= test session starts ==============================
platform linux -- Python 3.8.0, pytest-8.1.1, pluggy-1.4.0
rootdir: /SeleniumBase/examples
configfile: pytest.ini
plugins: seleniumbase-4.25.3, rerunfailures-14.0, html-2.0.1, metadata-3.1.1, cov-5.0.0, ordering-0.6, xdist-3.5.0
collected 1 item

my_first_test.py 
Warning: chromedriver update needed. Getting it now:

*** chromedriver to download = 123.0.6312.122 (Latest Stable) 

Downloading chromedriver-linux64.zip from:
https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/linux64/chromedriver-linux64.zip ...
Download Complete!

Extracting ['chromedriver'] from chromedriver-linux64.zip ...
Unzip Complete!

The file [chromedriver] was saved to:
/usr/local/lib/python3.8/dist-packages/seleniumbase/drivers/chromedriver

Making [chromedriver 123.0.6312.122] executable ...
[chromedriver 123.0.6312.122] is now ready for use!

F```

```>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
E         (session not created: DevToolsActivePort file doesn't exist)
E         (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
E       Stacktrace:
E       #0 0x00400077a863 <unknown>
E       #1 0x0040004708c6 <unknown>
E       #2 0x0040004a4d34 <unknown>
E       #3 0x0040004a0d3d <unknown>
E       #4 0x0040004e9aed <unknown>
E       #5 0x0040004dd343 <unknown>
E       #6 0x0040004ae593 <unknown>
E       #7 0x0040004aef5e <unknown>
E       #8 0x00400073e84b <unknown>
E       #9 0x0040007427a5 <unknown>
E       #10 0x00400072c571 <unknown>
E       #11 0x004000743332 <unknown>
E       #12 0x00400071187f <unknown>
E       #13 0x004000769728 <unknown>
E       #14 0x0040007698fb <unknown>
E       #15 0x0040007799b4 <unknown>
E       #16 0x004002bc96db start_thread

/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py:229: SessionNotCreatedException

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/dist-packages/seleniumbase/fixtures/base_case.py:14645: in setUp
    self.driver = self.get_new_driver(
/usr/local/lib/python3.8/dist-packages/seleniumbase/fixtures/base_case.py:4018: in get_new_driver
    new_driver = browser_launcher.get_driver(
/usr/local/lib/python3.8/dist-packages/seleniumbase/core/browser_launcher.py:1632: in get_driver
    return get_local_driver(
/usr/local/lib/python3.8/dist-packages/seleniumbase/core/browser_launcher.py:3879: in get_local_driver
    driver = webdriver.Chrome(
/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chrome/webdriver.py:45: in __init__
    super().__init__(
/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chromium/webdriver.py:61: in __init__
    super().__init__(command_executor=executor, options=options)
/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py:208: in __init__
    self.start_session(capabilities)
/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py:292: in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py:347: in execute
    self.error_handler.check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x4009f0c610>
response = {'status': 500, 'value': '{"value":{"error":"session not created","message":"session not created: DevToolsActivePort f...wn>\\n#15 0x0040007698fb \\u003Cunknown>\\n#16 0x0040007799b4 \\u003Cunknown>\\n#17 0x004002bc96db start_thread\\n"}}'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUh oh... Something needs to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions