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

On macOS, Chrome 120+, UC Mode, and Headless Mode, the browser gets stuck after script ends #2375

Closed
mdmintz opened this issue Dec 19, 2023 · 1 comment · Fixed by #2376
Closed
Assignees
Labels
bug Uh oh... Something needs to be fixed UC Mode Undetected Chromedriver Mode (--uc)

Comments

@mdmintz
Copy link
Member

mdmintz commented Dec 19, 2023

On macOS, Chrome 120+, UC Mode, and Headless Mode, the browser gets stuck after the script tries to quit the browser at the end.

(When ALL of those settings are combined, that leads to the issue where the driver/browser gets stuck during the quit() process.)

This is likely caused by a change in Chrome 120 / chromedriver 120, where os.waitpid() isn't getting the same result anymore when the browser process is terminated:

os.waitpid(self.browser_pid, 0)

The stack trace confirms it:

Traceback (most recent call last):
  File "/Users/michael/github/SeleniumBase/examples/raw_uc_mode.py", line 4, in <module>
    with SB(uc=True, test=True, headless=True) as sb:
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/Users/michael/github/SeleniumBase/seleniumbase/plugins/sb_manager.py", line 924, in SB
    sb.tearDown()
  File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/base_case.py", line 15997, in tearDown
    self.__quit_all_drivers()
  File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/base_case.py", line 14952, in __quit_all_drivers
    driver.quit()
  File "/Users/michael/github/SeleniumBase/seleniumbase/undetected/__init__.py", line 450, in quit
    os.waitpid(self.browser_pid, 0)
KeyboardInterrupt

Currently have to use CTRL+C to terminate the script from the console.

@mdmintz mdmintz added bug Uh oh... Something needs to be fixed UC Mode Undetected Chromedriver Mode (--uc) labels Dec 19, 2023
@mdmintz mdmintz self-assigned this Dec 19, 2023
@mdmintz mdmintz changed the title On macOS, Chrome 120 (or newer), UC Mode, and Headless Mode, the browser gets stuck after script On macOS, Chrome 120+, UC Mode, and Headless Mode, the browser gets stuck after script ends Dec 19, 2023
@mdmintz
Copy link
Member Author

mdmintz commented Dec 19, 2023

This was resolved by 4.22.1 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.22.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh oh... Something needs to be fixed UC Mode Undetected Chromedriver Mode (--uc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant