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

pytest_harvest_xdist_worker_dump not getting called #48

Closed
rhshadrach opened this issue Mar 4, 2021 · 6 comments
Closed

pytest_harvest_xdist_worker_dump not getting called #48

rhshadrach opened this issue Mar 4, 2021 · 6 comments

Comments

@rhshadrach
Copy link

We just upgraded packages and we're finding that pytest_harvest_xdist_worker_dump is not getting called.

Previous versions:

pytest                    6.0.1            py37hc8dfbb8_0    conda-forge
pytest-forked             1.2.0              pyh9f0ad1d_0    conda-forge
pytest-harvest            1.10.1                   pypi_0    pypi
pytest-xdist              2.0.0                      py_0    conda-forge

New versions:

pytest                    6.2.2            py37h89c1867_0    conda-forge
pytest-forked             1.3.0              pyhd3deb0d_0    conda-forge
pytest-harvest            1.10.1                   pypi_0    pypi
pytest-xdist              2.2.1              pyhd8ed1ab_0    conda-forge

Instead, to get pytest-harvest to work, we have to call our implementation of pytest_harvest_xdist_worker_dump from pytest_sessionfinish, which is the same implementation as here:

https://smarie.github.io/python-pytest-harvest/#pytest-x-dist

except that we do not dump session_items (causes a pickling error for us, and we don't need it). We use the following code in pytest_sessionfinish to do so.

if not is_main_process(session):
    worker_id = get_xdist_worker_id(session)
    fixture_store = get_fixture_store(session)
    pytest_harvest_xdist_worker_dump(worker_id, {}, fixture_store)

Is this expected to be necessary? Previously, I thought pytest-harvest was automatically detecting and calling our implementation of pytest_harvest_xdist_worker_dump.

@smarie
Copy link
Owner

smarie commented Apr 1, 2021

THanks @rhshadrach for the feedback ! Surprisingly, I'm receiving this notification just now :(
I'll have to investigate, maybe something changed in pytest-xdist ?

@smarie
Copy link
Owner

smarie commented Apr 1, 2021

I confirm that I can now reproduce the issue

@smarie
Copy link
Owner

smarie commented Apr 1, 2021

The origin is simple: my old pull request was accepted pytest-dev/pytest-xdist#505
but I do not use it :)

@smarie smarie closed this as completed in c499ff9 Apr 1, 2021
@smarie
Copy link
Owner

smarie commented Apr 1, 2021

Actually the cause was not this. Rather, funcargnames seems to have disappeared from pytest item api - which was causing one of my hook to fail silently

c499ff9#diff-93998b7e30b1deb577455fb069b07b7901f08a23277e8b84fb7247dd71823d72R587

@smarie
Copy link
Owner

smarie commented Apr 1, 2021

Fixed in 1.10.3, let me know @rhshadrach !

@rhshadrach
Copy link
Author

Thanks @smarie! Confirmed it's now working in 1.10.3

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

2 participants