Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧑‍🌾 test_mypy and test_xmllint failure: failed on setup with "AttributeError... in windows release #518

Open
Crola1702 opened this issue Jan 28, 2025 · 3 comments
Assignees

Comments

@Crola1702
Copy link
Contributor

Bug report

  • Operating System:
    • Windows
  • Installation type:
    • Source
  • Version or commit hash:
    • Rolling

Reference build: https://ci.ros2.org/job/nightly_win_rel/3312/#showFailuresLink

Test regressions:

Log output:

C:\Python38\lib\site-packages\_pytest\runner.py:311: in from_call
    result: Optional[TResult] = func()
C:\Python38\lib\site-packages\_pytest\runner.py:255: in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
C:\Python38\lib\site-packages\pluggy\_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
C:\Python38\lib\site-packages\pluggy\_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
C:\Python38\lib\site-packages\_pytest\runner.py:150: in pytest_runtest_setup
    item.session._setupstate.prepare(item)
C:\Python38\lib\site-packages\_pytest\runner.py:447: in prepare
    self.stack.append(col)
E   AttributeError: 'dict' object has no attribute 'append'

Buildfarmer scripts shows a change from build 3308 (without the regressions) to 3309 (with the regressions):

   ament\ament_lint:
     type: git
     url: https://github.com/ament/ament_lint.git
-    version: 33cf3644d4995d7550fb159e1cde688f44872c3d
+    version: 03194e1f819a8136fc3bf77bf11d39a90aac5dfd

Which gives the impression that #516 caused this regression on Windows.

@Crola1702 Crola1702 changed the title 🧑‍🌾 test_mypy and test_xmllint failure: failed on setup with "AttributeError... 🧑‍🌾 test_mypy and test_xmllint failure: failed on setup with "AttributeError... in windows release Jan 28, 2025
@sloretz sloretz self-assigned this Jan 28, 2025
@sloretz
Copy link
Contributor

sloretz commented Jan 28, 2025

Longer log from console output:
--- output: ament_mypy
============================= test session starts =============================

platform win32 -- Python 3.8.3, pytest-6.2.5, py-1.11.0, pluggy-1.5.0

cachedir: C:\ci\ws\build\ament_mypy\.pytest_cache

rootdir: C:\ci\ws\src\ament\ament_lint\ament_mypy, configfile: pytest.ini

plugins: ament-copyright-0.19.0, ament-flake8-0.19.0, ament-lint-0.19.0, ament-mypy-0.19.0, ament-pep257-0.19.0, ament-xmllint-0.19.0, launch-pytest-3.7.1, launch-testing-3.7.1, launch-testing-ros-0.28.0, colcon-core-0.18.4, cov-5.0.0, mock-3.14.0, repeat-0.9.3, rerunfailures-14.0, timeout-2.1.0

collected 12 items



test\test_ament_mypy.py .........                                        [ 75%]

test\test_flake8.py .                                                    [ 83%]

test\test_mypy.py RRE                                                    [ 91%]

Warning: A plugin raised an exception during an old-style hookwrapper teardown.

Plugin: terminalreporter, Hook: pytest_sessionfinish

AssertionError: 

For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning


Traceback (most recent call last):

  File "C:\Python38\lib\runpy.py", line 194, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "C:\Python38\lib\runpy.py", line 87, in _run_code

    exec(code, run_globals)

  File "C:\Python38\lib\site-packages\pytest\__main__.py", line 5, in <module>

    raise SystemExit(pytest.console_main())

  File "C:\Python38\lib\site-packages\_pytest\config\__init__.py", line 185, in console_main

    code = main()

  File "C:\Python38\lib\site-packages\_pytest\config\__init__.py", line 162, in main

    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(

  File "C:\Python38\lib\site-packages\pluggy\_hooks.py", line 513, in __call__

    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_manager.py", line 120, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 139, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

  File "C:\Python38\lib\site-packages\_pytest\main.py", line 316, in pytest_cmdline_main

    return wrap_session(config, _main)

  File "C:\Python38\lib\site-packages\_pytest\main.py", line 304, in wrap_session

    config.hook.pytest_sessionfinish(

  File "C:\Python38\lib\site-packages\pluggy\_hooks.py", line 513, in __call__

    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_manager.py", line 120, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 156, in _multicall

    teardown[0].send(outcome)

  File "C:\Python38\lib\site-packages\_pytest\terminal.py", line 803, in pytest_sessionfinish

    outcome.get_result()

  File "C:\Python38\lib\site-packages\pluggy\_result.py", line 100, in get_result

    raise exc.with_traceback(exc.__traceback__)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 103, in pytest_sessionfinish

    session._setupstate.teardown_all()

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 414, in teardown_all

    self._teardown_with_finalization(key)

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 408, in _teardown_with_finalization

    assert colitem in self.stack

AssertionError

test\test_xmllint.py R                                                   [100%]R [100%]E [100%]---
--- stderr: ament_mypy
Warning: A plugin raised an exception during an old-style hookwrapper teardown.

Plugin: terminalreporter, Hook: pytest_sessionfinish

AssertionError: 

For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning


Traceback (most recent call last):

  File "C:\Python38\lib\runpy.py", line 194, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "C:\Python38\lib\runpy.py", line 87, in _run_code

    exec(code, run_globals)

  File "C:\Python38\lib\site-packages\pytest\__main__.py", line 5, in <module>

    raise SystemExit(pytest.console_main())

  File "C:\Python38\lib\site-packages\_pytest\config\__init__.py", line 185, in console_main

    code = main()

  File "C:\Python38\lib\site-packages\_pytest\config\__init__.py", line 162, in main

    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(

  File "C:\Python38\lib\site-packages\pluggy\_hooks.py", line 513, in __call__

    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_manager.py", line 120, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 139, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

  File "C:\Python38\lib\site-packages\_pytest\main.py", line 316, in pytest_cmdline_main

    return wrap_session(config, _main)

  File "C:\Python38\lib\site-packages\_pytest\main.py", line 304, in wrap_session

    config.hook.pytest_sessionfinish(

  File "C:\Python38\lib\site-packages\pluggy\_hooks.py", line 513, in __call__

    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_manager.py", line 120, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 156, in _multicall

    teardown[0].send(outcome)

  File "C:\Python38\lib\site-packages\_pytest\terminal.py", line 803, in pytest_sessionfinish

    outcome.get_result()

  File "C:\Python38\lib\site-packages\pluggy\_result.py", line 100, in get_result

    raise exc.with_traceback(exc.__traceback__)

  File "C:\Python38\lib\site-packages\pluggy\_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 103, in pytest_sessionfinish

    session._setupstate.teardown_all()

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 414, in teardown_all

    self._teardown_with_finalization(key)

  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 408, in _teardown_with_finalization

    assert colitem in self.stack

AssertionError

---
Finished <<< ament_mypy [24.2s]	[ with test failures ]

@cottsay
Copy link
Contributor

cottsay commented Jan 28, 2025

Python 3.8 is EOL. Is it possible that a recent pytest or pluggy release broke it? Can we try pinning?

@sloretz
Copy link
Contributor

sloretz commented Jan 28, 2025

Maybe the logs I posted aren't the original exception? pytest-dev/pytest#7724 has similar logs caused by an exception being raised in a plugin in a previous test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants