Bug 1254222

Summary: [Debian] pthreading fails unit testing
Product: [oVirt] ovirt-distribution Reporter: Sandro Bonazzola <sbonazzo>
Component: python-pthreadingAssignee: Milan Zamazal <mzamazal>
python-pthreading sub component: Packaging.Debian QA Contact: Lukas Svaty <lsvaty>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: unspecified CC: bugs, sbonazzo, ybronhei
Version: ---Flags: sbonazzo: ovirt-4.3-
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-27 07:28:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: External RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1163069    

Description Sandro Bonazzola 2015-08-17 12:58:30 UTC
# tox -c tox.ini 
GLOB sdist-make: /root/pthreading/setup.py
pep8 inst-nodeps: /root/pthreading/.tox/dist/pthreading-0.1.3-4.zip
pep8 runtests: PYTHONHASHSEED='1269487145'
pep8 runtests: commands[0] | flake8 --max-line-length=80 --exclude=.tox,.git,dist,build /root/pthreading
py27 inst-nodeps: /root/pthreading/.tox/dist/pthreading-0.1.3-4.zip
py27 runtests: PYTHONHASHSEED='1269487145'
test inst-nodeps: /root/pthreading/.tox/dist/pthreading-0.1.3-4.zip
test runtests: PYTHONHASHSEED='1269487145'
test runtests: commands[0] | py.test -v tests.py
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.4.2 -- py-1.4.30 -- pytest-2.7.2 -- /root/pthreading/.tox/test/bin/python3
rootdir: /root/pthreading, inifile: 
collected 30 items 

tests.py::TestMonkeyPatch::test_monkey_patch FAILED
tests.py::TestMonkeyPatch::test_monkey_patch_twice FAILED
tests.py::TestMonkeyPatch::test_monkey_patch_raises_thread FAILED
tests.py::TestMonkeyPatch::test_monkey_patch_raises_threading FAILED
tests.py::TestLock::test_acquire[lock0] PASSED
tests.py::TestLock::test_acquire[lock1] PASSED
tests.py::TestLock::test_release[lock0] PASSED
tests.py::TestLock::test_release[lock1] PASSED
tests.py::TestLock::test_acquire_nonblocking PASSED
tests.py::TestLock::test_acquire_recursive PASSED
tests.py::TestLock::test_locked PASSED
tests.py::TestCondition::test_notify[None] PASSED
tests.py::TestCondition::test_notify[lock1] PASSED
tests.py::TestCondition::test_notify[lock2] PASSED
tests.py::TestCondition::test_notify_all[None] PASSED
tests.py::TestCondition::test_notify_all[lock1] PASSED
tests.py::TestCondition::test_notify_all[lock2] PASSED
tests.py::TestCondition::test_timeout[None-1] PASSED
tests.py::TestCondition::test_timeout[lock1-1] PASSED
tests.py::TestCondition::test_timeout[lock2-1] PASSED
tests.py::TestCondition::test_timeout[None-0.1] PASSED
tests.py::TestCondition::test_timeout[lock4-0.1] PASSED
tests.py::TestCondition::test_timeout[lock5-0.1] PASSED
tests.py::TestCondition::test_timeout_notify[None-1] PASSED
tests.py::TestCondition::test_timeout_notify[lock1-1] PASSED
tests.py::TestCondition::test_timeout_notify[lock2-1] PASSED
tests.py::TestEvent::test_timeout_not_expired[None] PASSED
tests.py::TestEvent::test_timeout_not_expired[5] PASSED
tests.py::TestEvent::test_timeout_expired[0] PASSED
tests.py::TestEvent::test_timeout_expired[0.5] PASSED

==================================================================================================== FAILURES =====================================================================================================
________________________________________________________________________________________ TestMonkeyPatch.test_monkey_patch ________________________________________________________________________________________

self = <tests.TestMonkeyPatch object at 0x7f2712784588>, monkeypatch = <_pytest.monkeypatch.monkeypatch object at 0x7f2712784630>

    def test_monkey_patch(self, monkeypatch):
>       monkeypatch.delitem(sys.modules, "thread")

tests.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.monkeypatch.monkeypatch object at 0x7f2712784630>
dic = {'__future__': <module '__future__' from '/root/pthreading/.tox/test/lib/python3.4/__future__.py'>, '__main__': <modul...in__' from '.tox/test/bin/py.test'>, '_ast': <module '_ast' (built-in)>, '_bisect': <module '_bisect' (built-in)>, ...}
name = 'thread', raising = True

    def delitem(self, dic, name, raising=True):
        """ Delete ``name`` from dict. Raise KeyError if it doesn't exist.
    
            If ``raising`` is set to False, no exception will be raised if the
            key is missing.
            """
        if name not in dic:
            if raising:
>               raise KeyError(name)
E               KeyError: 'thread'

.tox/test/lib/python3.4/site-packages/_pytest/monkeypatch.py:150: KeyError
_____________________________________________________________________________________ TestMonkeyPatch.test_monkey_patch_twice _____________________________________________________________________________________

self = <tests.TestMonkeyPatch object at 0x7f2712784320>, monkeypatch = <_pytest.monkeypatch.monkeypatch object at 0x7f27127848d0>

    def test_monkey_patch_twice(self, monkeypatch):
>       monkeypatch.delitem(sys.modules, "thread")

tests.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.monkeypatch.monkeypatch object at 0x7f27127848d0>
dic = {'__future__': <module '__future__' from '/root/pthreading/.tox/test/lib/python3.4/__future__.py'>, '__main__': <modul...in__' from '.tox/test/bin/py.test'>, '_ast': <module '_ast' (built-in)>, '_bisect': <module '_bisect' (built-in)>, ...}
name = 'thread', raising = True

    def delitem(self, dic, name, raising=True):
        """ Delete ``name`` from dict. Raise KeyError if it doesn't exist.
    
            If ``raising`` is set to False, no exception will be raised if the
            key is missing.
            """
        if name not in dic:
            if raising:
>               raise KeyError(name)
E               KeyError: 'thread'

.tox/test/lib/python3.4/site-packages/_pytest/monkeypatch.py:150: KeyError
_________________________________________________________________________________ TestMonkeyPatch.test_monkey_patch_raises_thread _________________________________________________________________________________

self = <tests.TestMonkeyPatch object at 0x7f2712772cc0>, monkeypatch = <_pytest.monkeypatch.monkeypatch object at 0x7f27127726d8>

    def test_monkey_patch_raises_thread(self, monkeypatch):
>       monkeypatch.delitem(sys.modules, "thread")

tests.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_pytest.monkeypatch.monkeypatch object at 0x7f27127726d8>
dic = {'__future__': <module '__future__' from '/root/pthreading/.tox/test/lib/python3.4/__future__.py'>, '__main__': <modul...in__' from '.tox/test/bin/py.test'>, '_ast': <module '_ast' (built-in)>, '_bisect': <module '_bisect' (built-in)>, ...}
name = 'thread', raising = True

    def delitem(self, dic, name, raising=True):
        """ Delete ``name`` from dict. Raise KeyError if it doesn't exist.
    
            If ``raising`` is set to False, no exception will be raised if the
            key is missing.
            """
        if name not in dic:
            if raising:
>               raise KeyError(name)
E               KeyError: 'thread'

.tox/test/lib/python3.4/site-packages/_pytest/monkeypatch.py:150: KeyError
_______________________________________________________________________________ TestMonkeyPatch.test_monkey_patch_raises_threading ________________________________________________________________________________

self = <tests.TestMonkeyPatch object at 0x7f2712780c50>, monkeypatch = <_pytest.monkeypatch.monkeypatch object at 0x7f2712780f28>

    def test_monkey_patch_raises_threading(self, monkeypatch):
        monkeypatch.delitem(sys.modules, "threading")
>       assert 'thread' in sys.modules
E       assert 'thread' in {'__future__': <module '__future__' from '/root/pthreading/.tox/test/lib/python3.4/__future__.py'>, '__main__': <modul...in__' from '.tox/test/bin/py.test'>, '_ast': <module '_ast' (built-in)>, '_bisect': <module '_bisect' (built-in)>, ...}
E        +  where {'__future__': <module '__future__' from '/root/pthreading/.tox/test/lib/python3.4/__future__.py'>, '__main__': <modul...in__' from '.tox/test/bin/py.test'>, '_ast': <module '_ast' (built-in)>, '_bisect': <module '_bisect' (built-in)>, ...} = sys.modules

tests.py:56: AssertionError
======================================================================================= 4 failed, 26 passed in 8.32 seconds =======================================================================================
ERROR: InvocationError: '/root/pthreading/.tox/test/bin/py.test -v tests.py'
_____________________________________________________________________________________________________ summary _____________________________________________________________________________________________________
  pep8: commands succeeded
  py27: commands succeeded
ERROR:   test: commands failed

Comment 1 Oved Ourfali 2016-03-15 08:04:45 UTC
Sandro - as we're not working on debian porting in the infra team, is the integration team pushing that? If so, please move to integration.
If not, please close as wontfix.

Comment 2 Sandro Bonazzola 2016-03-15 10:44:38 UTC
Milan (set as assignee) is porting vdsm to Debian. This bug was discovered while integration team was doing that.

Above issue looks related to python3 and IIUC python 3 support is an ongoing effort for 4.0. Fixing python3 support should fix this as well.

Milan, feel free to set oVirt team to your team, I'm moving to external for now.

Comment 3 Sandro Bonazzola 2016-05-02 10:05:20 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 4 Yaniv Lavi 2016-05-23 13:20:02 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 5 Yaniv Lavi 2016-05-23 13:23:36 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 6 Milan Zamazal 2018-03-21 16:37:05 UTC
I don't think anybody cares about using Debian hosts anymore and I've abandoned my Debian work for that reason long time ago. So I suggest closing this bug as WONTFIX.