Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2393

regression when using pytest-forked (infinite recursion)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.6.0, 6.5.3
    • 6.5.1.1
    • Shiboken
    • None
    • Linux/X11
    • 8adc38c47 (dev), dc391f14c (6.5)

    Description

      This test has been working with shiboken 6.4.1, but it stopped working after updating to 6.5.1.1. We need the --forked option since otherwise we get into other troubles while testing the gui, probably due to insufficient isolation of the test cases. The python environment is

      $ python --version
      Python 3.9.2

      $ pip freeze
      exceptiongroup==1.1.2
      iniconfig==2.0.0
      packaging==23.1
      pluggy==1.2.0
      py==1.11.0
      PySide6==6.5.1.1
      PySide6-Addons==6.5.1.1
      PySide6-Essentials==6.5.1.1
      pytest==7.4.0
      pytest-forked==1.6.0
      shiboken6==6.5.1.1
      tomli==2.0.1

      and a minimal test case showing the problem is this:

      $ cat test_dummy.py  
      import pytest
      import shiboken6

      def test_dummy():
         pass

      $ pytest --forked test_dummy.py | head -n 80
      ============================= test session starts ==============================
      platform linux – Python 3.9.2, pytest-7.4.0, pluggy-1.2.0
      rootdir: <snip>
      plugins: forked-1.6.0
      collected 1 item

      test_dummy.py  
      INTERNALERROR> Traceback (most recent call last):
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/_pytest/main.py", line 270, in wrap_session
      INTERNALERROR>     session.exitstatus = doit(config, session) or 0
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/_pytest/main.py", line 324, in _main
      INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/hooks.py", line 433, in __call_
      INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_manager.py", line 112, in _hookexec
      INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_callers.py", line 155, in _multicall
      INTERNALERROR>     return outcome.get_result()
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_result.py", line 108, in get_result
      INTERNALERROR>     raise exc.with_traceback(exc.{}traceback{})
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_callers.py", line 80, in _multicall
      INTERNALERROR>     res = hook_impl.function(*args)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/_pytest/main.py", line 349, in pytest_runtestloop
      INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/hooks.py", line 433, in __call_
      INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_manager.py", line 112, in _hookexec
      INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_callers.py", line 155, in _multicall
      INTERNALERROR>     return outcome.get_result()
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_result.py", line 108, in get_result
      INTERNALERROR>     raise exc.with_traceback(exc.{}traceback{})
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pluggy/_callers.py", line 80, in _multicall
      INTERNALERROR>     res = hook_impl.function(*args)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pytest_forked/{}init{}.py", line 51, in pytest_runtest_protocol
      INTERNALERROR>     reports = forked_run_report(item)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/pytest_forked/{}init{}.py", line 73, in forked_run_report
      INTERNALERROR>     ff = py.process.ForkedFunc(runforked)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 157, in __makeattr
      INTERNALERROR>     result = importobj(modpath, attrname)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 75, in importobj
      INTERNALERROR>     module = {}import{}(modpath, None, None, ["__doc__"])
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/_process/forkedfunc.py", line 8, in <module>
      INTERNALERROR>     import py
      INTERNALERROR>   File "shibokensupport/signature/loader.py", line 61, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 137, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 148, in _mod_uses_pyside
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 1024, in getsource
      INTERNALERROR>     lines, lnum = getsourcelines(object)
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 1006, in getsourcelines
      INTERNALERROR>     lines, lnum = findsource(object)
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 831, in findsource
      INTERNALERROR>     lines = linecache.getlines(file, module.{}dict{})
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init.py", line 177, in __dict_
      INTERNALERROR>     self.__makeattr(name)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 157, in __makeattr
      INTERNALERROR>     result = importobj(modpath, attrname)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 75, in importobj
      INTERNALERROR>     module = {}import{}(modpath, None, None, ["__doc__"])
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/__metainfo.py", line 1, in <module>
      INTERNALERROR>     import py
      INTERNALERROR>   File "shibokensupport/signature/loader.py", line 61, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 137, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 148, in _mod_uses_pyside
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 1024, in getsource
      INTERNALERROR>     lines, lnum = getsourcelines(object)
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 1006, in getsourcelines
      INTERNALERROR>     lines, lnum = findsource(object)
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 831, in findsource
      INTERNALERROR>     lines = linecache.getlines(file, module.{}dict{})
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init.py", line 177, in __dict_
      INTERNALERROR>     self.__makeattr(name)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 157, in __makeattr
      INTERNALERROR>     result = importobj(modpath, attrname)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 75, in importobj
      INTERNALERROR>     module = {}import{}(modpath, None, None, ["__doc__"])
      INTERNALERROR>   File "shibokensupport/signature/loader.py", line 61, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 137, in feature_imported
      INTERNALERROR>   File "shibokensupport/feature.py", line 148, in _mod_uses_pyside
      INTERNALERROR>   File "/usr/lib/python3.9/inspect.py", line 1024, in getsource

       

      .... snip ....

      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init.py", line 177, in __dict_
      INTERNALERROR>     self.__makeattr(name)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 157, in __makeattr
      INTERNALERROR>     result = importobj(modpath, attrname)
      INTERNALERROR>   File "/tmp/venv/lib/python3.9/site-packages/py/vendored_packages/apipkg/init_.py", line 75, in importobj
      INTERNALERROR>     module = {}import{}(modpath, None, None, ["__doc__"])
      INTERNALERROR>   File "shibokensupport/signature/loader.py", line 54, in feature_import
      INTERNALERROR> RecursionError: maximum recursion depth exceeded

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-2393
          # Subject Branch Project Status CR V

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              bdev a dev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes