From 0fd93b86c46d96fd14a67b5ef516fdafd788efb8 Mon Sep 17 00:00:00 2001 From: Alexander Lussier-Cullen Date: Thu, 14 Dec 2023 16:05:35 -0500 Subject: bitbake: toaster/tests: fix chrome argument syntax and wait for driver exit The chrome driver sometimes fails with a page crash for a full suite of tests, pointing to a failure in the setup of the driver due to resource limitations. To mitigate these crashes, add a wait between driver driven tests to ensure resources are freed. (Bitbake rev: 8f998e27aae694c16f788aac12558621089d0839) Signed-off-by: Alexander Lussier-Cullen Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index b32e89d7f3..5d0489bb4e 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py @@ -36,7 +36,7 @@ def create_selenium_driver(cls,browser='chrome'): if browser == 'chrome': options = webdriver.ChromeOptions() - options.add_argument('headless') + options.add_argument('--headless') options.add_argument('--disable-infobars') options.add_argument('--disable-dev-shm-usage') options.add_argument('--no-sandbox') @@ -166,6 +166,8 @@ class SeleniumTestCaseBase(unittest.TestCase): """ Clean up webdriver driver """ cls.driver.quit() + # Allow driver resources to be properly freed before proceeding with further tests + time.sleep(5) super(SeleniumTestCaseBase, cls).tearDownClass() def get(self, url): -- cgit v1.2.3-54-g00ecf