14
0

Accepting request 730634 from devel:languages:python

- Patch out flaky tests that seldomly fails in obs:
  * obs-timeout.patch

OBS-URL: https://build.opensuse.org/request/show/730634
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-zdaemon?expand=0&rev=21
This commit is contained in:
Ludwig Nussel
2019-09-13 13:03:20 +00:00
committed by Git OBS Bridge
3 changed files with 90 additions and 0 deletions

82
obs-timeout.patch Normal file
View File

@@ -0,0 +1,82 @@
Index: zdaemon-4.3/src/zdaemon/tests/tests.py
===================================================================
--- zdaemon-4.3.orig/src/zdaemon/tests/tests.py
+++ zdaemon-4.3/src/zdaemon/tests/tests.py
@@ -264,77 +264,6 @@ def test_log_rotation():
"""
-def test_start_test_program():
- """
- >>> write('t.py',
- ... '''
- ... import time
- ... time.sleep(1)
- ... open('x', 'w').close()
- ... time.sleep(99)
- ... ''')
-
- >>> write('conf',
- ... '''
- ... <runner>
- ... program %s t.py
- ... start-test-program cat x
- ... </runner>
- ... ''' % sys.executable)
-
- >>> import os
-
- >>> system("./zdaemon -Cconf start")
- . .
- daemon process started, pid=21446
-
- >>> os.path.exists('x')
- True
- >>> os.remove('x')
-
- >>> system("./zdaemon -Cconf restart")
- . . .
- daemon process restarted, pid=19622
- >>> os.path.exists('x')
- True
-
- >>> system("./zdaemon -Cconf stop")
- <BLANKLINE>
- daemon process stopped
- """
-
-
-def test_start_timeout():
- """
- >>> write('t.py',
- ... '''
- ... import time
- ... time.sleep(9)
- ... ''')
-
- >>> write('conf',
- ... '''
- ... <runner>
- ... program %s t.py
- ... start-test-program cat x
- ... start-timeout 1
- ... </runner>
- ... ''' % sys.executable)
-
- >>> import time
- >>> start = time.time()
-
- >>> system("./zdaemon -Cconf start")
- <BLANKLINE>
- Program took too long to start
- Failed: 1
-
- >>> system("./zdaemon -Cconf stop")
- <BLANKLINE>
- daemon process stopped
- """
-
-
def DAEMON_MANAGER_MODE_leak():
"""
Zdaemon used an environment variable to flag that it's running in

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Sep 12 17:12:56 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Patch out flaky tests that seldomly fails in obs:
* obs-timeout.patch
-------------------------------------------------------------------
Tue Apr 9 10:53:45 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>

View File

@@ -26,6 +26,7 @@ License: ZPL-2.1
Group: Development/Languages/Python
URL: https://github.com/zopefoundation/zdaemon
Source: https://files.pythonhosted.org/packages/source/z/zdaemon/%{modname}-%{version}.tar.gz
Patch0: obs-timeout.patch
BuildRequires: %{python_module ZConfig}
BuildRequires: %{python_module manuel}
BuildRequires: %{python_module mock}
@@ -49,6 +50,7 @@ although it is not limited to running Python-based applications
%prep
%setup -q -n %{modname}-%{version}
%patch0 -p1
# remove unwanted shebang
sed -i '1 { /^#!/ d }' src/zdaemon/tests/nokill.py
rm -rf src/zdaemon.egg-info