[kde-linux/os-autoinst-distri-kdelinux] extensions/openqa/usr/lib/kde-linux-openqa/tests: Catch and handle transient plasma_setup error

Thomas Duckworth <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 72af2e9c1e3f6792a65e811beb2abef7b2e76ca3 by Thomas Duckworth.
Committed on 25/07/2026 at 10:13.
Pushed by tduck into branch 'master'.

Catch and handle transient plasma_setup error

This occasional exception keeps flaking out the plasma_setup test -
catch and ignore it.

M  +10   -2    extensions/openqa/usr/lib/kde-linux-openqa/tests/plasma_setup.py

https://invent.kde.org/kde-linux/os-autoinst-distri-kdelinux/-/commit/72af2e9c1e3f6792a65e811beb2abef7b2e76ca3

diff --git a/extensions/openqa/usr/lib/kde-linux-openqa/tests/plasma_setup.py b/extensions/openqa/usr/lib/kde-linux-openqa/tests/plasma_setup.py
index a2ba97b..8070263 100644
--- a/extensions/openqa/usr/lib/kde-linux-openqa/tests/plasma_setup.py
+++ b/extensions/openqa/usr/lib/kde-linux-openqa/tests/plasma_setup.py
@@ -5,6 +5,7 @@ import unittest
 from appium import webdriver
 from appium.webdriver.common.appiumby import AppiumBy
 from appium.options.common.base import AppiumOptions
+from selenium.common.exceptions import WebDriverException
 from selenium.webdriver.support.ui import WebDriverWait
 from selenium.webdriver.support import expected_conditions as ec
 from lib.sut import openqa_junit_xml
@@ -39,8 +40,15 @@ class PlasmaSetupTests(unittest.TestCase):
 
         def reached_next_page(driver):
             # A prior click was accepted once the heading changes.
-            if driver.find_elements(AppiumBy.NAME, next_page_title):
-                return True
+            try:
+                if driver.find_elements(AppiumBy.NAME, next_page_title):
+                    return True
+            except WebDriverException as error:
+                # Catch this transient backend error and ignore it.
+                if "'NoneType' object is not iterable" in error.msg:
+                    return False
+                raise
+
             driver.find_element(AppiumBy.NAME, "Next").click()
             return False
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.