execnet icon indicating copy to clipboard operation
execnet copied to clipboard

gateway: Test concurrent rinfo for main_thread_only

Open zmedico opened this issue 1 year ago • 5 comments

Add test coverage for a bug triggered by pytest-cov when it tried to call _rinfo after the gateway was already busy with a remote_exec call:

https://github.com/pytest-dev/pytest-xdist/issues/1071

zmedico avatar Apr 19 '24 22:04 zmedico

Looks like something that would benefit from having an intentional test? And maybe some smoke tests with pytest-cov and pytest-xdist in the same env?

webknjaz avatar Apr 19 '24 22:04 webknjaz

@bluetech @RonnyPfannschmidt @nicoddemus I can't request reviews in this repo so tagging you instead.

This PR looks ready to be checked/merged.

webknjaz avatar Apr 23 '24 01:04 webknjaz

@zmedico Thanks for following up!

It seems to me better to merge https://github.com/pytest-dev/pytest-xdist/pull/1072 and not this. It seems intentional that execnet doesn't request rinfo always, allowing the user to choose whether to grab the info from the remote. But this change will "force" it.

The issue seems to me to be specific to xdist and pytest plugin architecture, where xdist can't control what another plugin does, otherwise it would simply avoid the issue.

WDYT?

bluetech avatar Apr 27 '24 07:04 bluetech

@zmedico Thanks for following up!

It seems to me better to merge pytest-dev/pytest-xdist#1072 and not this. It seems intentional that execnet doesn't request rinfo always, allowing the user to choose whether to grab the info from the remote. But this change will "force" it.

The issue seems to me to be specific to xdist and pytest plugin architecture, where xdist can't control what another plugin does, otherwise it would simply avoid the issue.

WDYT?

Yes, I agree that is nicer to allow a choice here. I suppose pytest-cov is not in a position to cache the rinfo, so it makes sense for pytest-xdist to handle it for backward compatibility.

I've adjusted this PR to just add test_concurrent_rinfo, and perform the rinfo caching for main_thread_only right inside the test,

Noted the change here: https://github.com/pytest-dev/pytest-xdist/issues/1071#issuecomment-2081126133

zmedico avatar Apr 27 '24 17:04 zmedico

@zmedico I admit I'm a bit confused what the test is testing. What is the failure it is testing against?

bluetech avatar Apr 27 '24 19:04 bluetech

Closed in favor of https://github.com/pytest-dev/pytest-xdist/pull/1072.

zmedico avatar Jun 10 '24 01:06 zmedico