Closed joshprice closed 1 month ago
Thanks @pda, I've verified using this repo https://github.com/team-alembic/pytest-bk-test-analytics which was a fork of https://github.com/adimoldovan/pytest-bk-test-analytics it'd be great if @adimoldovan can verify the fix on his repo.
I'd like to ensure we've got the most robust possible fix here with tests as well before we publish a new version.
Fixed no duplicates on the xdist-duplicates
branch:
Duplicates on current version:
I verified this, it looks good. Thanks for the fix @joshprice
@pda this should be good for a patch release
The way xdist works is somewhat surprising:
n+1
pytest executions (wheren
is the actual number of workers)This checks that we're in the controller process (eg the existence of "workerinput" implies an xdist worker thread), and only submits the results payload if we're in the controller or
master
process.The JUnit test reporter has a range of other strategies to deal with xdist but this particular check inspired this fix https://github.com/pytest-dev/pytest/blob/ac4189875562a6ce5b502c3dd87156c0367cf8f1/src/_pytest/junitxml.py#L429