MarketSquare / robotframework-browser

Robot Framework Browser library powered by Playwright.
Apache License 2.0
507 stars 104 forks source link

New Browser KW fails when run on Apple M1 chip with robot framework-browsert docker image #2440

Closed Remppa closed 1 year ago

Remppa commented 1 year ago

Describe the bug Test execution fails when trying to runNew Browser KW in suite setup. marketsquare/robotframework-browser docker image is used to run simple browser test. There has been growing amount of people facing similar problem on their Macs.

To Reproduce Steps to reproduce the behavior:

  1. Pull marketsquare/robotframework-browser docker image
  2. Create a test suite that contains New Browser with arguments: downloadsPath=${DOWNLOADS_DIR} headless=true browser=chromium args=['--no-sandbox', '--disable-setuid-sandbox', '--single-process'] NOTE! The example test for robot framework browser should be enough
  3. Execute the tests in docker container on MacOS M1 chip machine
  4. See error

Expected behavior Assumption is that the execution of the tests in M1 chip would not fail

Screenshots

Desktop (please complete the following information):

Additional context

10:18:53.984 INFO {"browser": "chromium", "headless": true, "args": ["--no-sandbox", "--disable-setuid-sandbox", "--single-process"], "devtools": false, "handleSIGHUP": true, "handleSIGINT": true, "handleSIGTERM": true, "slowMo": 0.0, "timeout": 30000.0, "deprecated_pos_args": [], "tracesDir": "/home/robot/robot_reports/browser/traces/d4304355-6f57-4b06-b541-8d3cfb41914b"}
10:18:56.897 WARN Keyword 'Take Screenshot fail-screenshot-{index}' could not be run on failure: Error: Tried to take screenshot, but no page was open.
10:18:56.899 FAIL Error: browserType.launch: Browser closed. ==================== Browser output: ====================

/home/pwuser/.local/lib/python3.8/site-packages/Browser/wrapper/node_modules/playwright-core/.local-browsers/chromium-1028/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-sandbox --disable-setuid-sandbox --single-process --user-data-dir=/tmp/playwright_chromiumdev_profile-2j6wws --remote-debugging-pipe --no-startup-window pid=197 [pid=197][err] [1129/081854.761222:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps [pid=197][err] [1129/081855.119595:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps [pid=197][err] [1129/081855.121545:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps [pid=197][err] [1129/081855.152224:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). [pid=197][err] #0 0x00400769f342 base::debug::CollectStackTrace() [pid=197][err] #1 0x0040076104f3 base::debug::StackTrace::StackTrace() [pid=197][err] #2 0x00400760d737 logging::LogMessage::~LogMessage() [pid=197][err] #3 0x00400760e4ce logging::LogMessage::~LogMessage() [pid=197][err] #4 0x00400715e437 content::ZygoteMain() [pid=197][err] #5 0x004007158871 content::RunZygote() [pid=197][err] #6 0x004007159734 content::RunOtherNamedProcessTypeMain() [pid=197][err] #7 0x00400715a617 content::ContentMainRunnerImpl::Run() [pid=197][err] #8 0x004007157ba9 content::RunContentProcess() [pid=197][err] #9 0x004007157d0e content::ContentMain() [pid=197][err] #10 0x0040071b9d86 headless::(anonymous namespace)::RunContentMain() [pid=197][err] #11 0x0040071b9c03 headless::RunChildProcessIfNeeded() [pid=197][err] #12 0x0040071b87d5 headless::HeadlessShellMain() [pid=197][err] #13 0x0040037591e3 ChromeMain [pid=197][err] #14 0x00401014e083 __libc_start_main [pid=197][err] #15 0x00400375902a _start [pid=197][err] [pid=197][err] [1129/081855.152231:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). [pid=197][err] #0 0x00400769f342 base::debug::CollectStackTrace() [pid=197][err] #1 0x0040076104f3 base::debug::StackTrace::StackTrace() [pid=197][err] #2 0x00400760d737 logging::LogMessage::~LogMessage() [pid=197][err] #3 0x00400760e4ce logging::LogMessage::~LogMessage() [pid=197][err] #4 0x00400715e437 content::ZygoteMain() [pid=197][err] #5 0x004007158871 content::RunZygote() [pid=197][err] #6 0x004007159734 content::RunOtherNamedProcessTypeMain() [pid=197][err] #7 0x00400715a617 content::ContentMainRunnerImpl::Run() [pid=197][err] #8 0x004007157ba9 content::RunContentProcess() [pid=197][err] #9 0x004007157d0e content::ContentMain() [pid=197][err] #10 0x0040071b9d86 headless::(anonymous namespace)::RunContentMain() [pid=197][err] #11 0x0040071b9c03 headless::RunChildProcessIfNeeded() [pid=197][err] #12 0x0040071b87d5 headless::HeadlessShellMain() [pid=197][err] #13 0x0040037591e3 ChromeMain [pid=197][err] #14 0x00401014e083 __libc_start_main [pid=197][err] #15 0x00400375902a _start [pid=197][err] [pid=197][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped [pid=197][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped [pid=197][err] Received signal 11 SEGV_MAPERR 20202020202028 [pid=197][err] #0 0x00400769f342 base::debug::CollectStackTrace() [pid=197][err] #1 0x0040076104f3 base::debug::StackTrace::StackTrace() [pid=197][err] #2 0x00400769ee61 base::debug::(anonymous namespace)::StackDumpSignalHandler() [pid=197][err] #3 0x00400f42a420 [pid=197][err] #4 0x0040087b5838 FcStrSerializeAlloc [pid=197][err] #5 0x0040087a3fae FcDirCacheBuild [pid=197][err] #6 0x0040087a9b46 FcDirCacheScan [pid=197][err] #7 0x0040087a9bde IA__FcDirCacheRead [pid=197][err] #8 0x00400879fa27 FcConfi
manykarim commented 1 year ago

Have you tried a different browser once, e.g. firefox?

Remppa commented 1 year ago

Hi @manykarim. The tests are executable when using Firefox.

aaltat commented 1 year ago

Ping @xylix this belongs on your expert area.

aaltat commented 1 year ago

@allcontributors please add @Remppa for bugs

allcontributors[bot] commented 1 year ago

@aaltat

I've put up a pull request to add @Remppa! :tada:

Remppa commented 1 year ago

Just tried with latest robot framework-browser and no luck. Any advice how push this issue to upstream? Or hints to find a workaround 🤔

xylix commented 1 year ago

This should work after the next release.

Nagam-Naidu commented 1 year ago

Do we have any idea when this will be fixed. We are also facing the same issue.

It is working with default browser(chromium) but failing when we are passing channel as chrome in new_browser function.

Remppa commented 1 year ago

The original issue described in this issue is fixed. I'm ok with closing this issue. Big thanks to @xylix & co.

xylix commented 1 year ago

Thanks for helping with all the details around the issue! And yeah should now work as expected on 16.0.1 and future robotframework-browser docker images.