[Toaster] toaster: fix chrome argument syntax and wait for driver exit

[email protected] Thu, 14 Dec 2023 16:05:35 -0500
Newsgroups org.yoctoproject.lists.toaster
Message-ID <20231214210535.787180-1-alexander.lussier-cullen@savoirfairelinux.com>
From: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux=
.com>

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.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirf=
airelinux.com>
---
 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 46ced5a167..2c8a778f79 100644
--- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
+++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
@@ -35,7 +35,7 @@ def create_selenium_driver(cls,browser=3D'chrome'):
=20
     if browser =3D=3D 'chrome':
         options =3D 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')
@@ -164,6 +164,8 @@ class SeleniumTestCaseBase(unittest.TestCase):
         """ Clean up webdriver driver """
=20
         cls.driver.quit()
+        # Allow driver resources to be properly freed before proceeding =
with further tests
+        time.sleep(5)
         super(SeleniumTestCaseBase, cls).tearDownClass()
=20
     def get(self, url):
--=20
2.34.1