jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1320831?usp=email )

Change subject: tests: skip TestScriptGenerator on TimeoutExpired
......................................................................

tests: skip TestScriptGenerator on TimeoutExpired

Skip TestScriptGenerator tests if a subprocess.TimeoutExpired
exception occurs. After the subprocess is terminated, its output may
be incomplete, making assertions about stdout and stderr unreliable.

Bug: T433834
Bug: T432996
Change-Id: Ie6b901ebabad1eaa963c12697d265723c66c7c11
---
M tests/script_tests.py
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Looks good to me, approved




diff --git a/tests/script_tests.py b/tests/script_tests.py
index 28fcf00..edd27e3 100755
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -206,6 +206,7 @@

             is_autorun = ('-help' not in args
                           and script_name in auto_run_script_set)
+            has_generator = '-always' in args

             def test_script(self) -> None:
                 global_args_msg = \
@@ -215,7 +216,7 @@
                 cmd = [*global_args, script_name, *args]
                 data_in = script_input.get(script_name)

-                if type(self._timeout) is int:
+                if type(self._timeout) in (int, float):
                     timeout = self._timeout
                 elif isinstance(self._timeout, bool):
                     timeout = 10 if self._timeout else None
@@ -261,6 +262,8 @@
                     self.skipTest(skip_result)

                 if error:
+                    if has_generator and timeout_error:
+                        self.skipTest(timeout_error)
                     self.assertIn(error, err_result)
                     exit_codes = [0, 1, 2, -9]


--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1320831?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie6b901ebabad1eaa963c12697d265723c66c7c11
Gerrit-Change-Number: 1320831
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to