Comment 2 for bug 2068642

Revision history for this message
Chris Peterson (cpete) wrote :

The culprit seems to be pytest setting the test._instance attribute to None instead of deleting the reference. It looks like upstream has the same conclusion [1].

This fixes the issue for python-flaky, but uncovered a separate issue for pytest-rerunfailures. Although there appears to be some related work upstream for this issue as well [2].

Please see the attached debdiff for the proposed fixes in [1] for pytest, which will resolve python-flaky's autopkgtest regression. I will separately look into whether [2] will fix the issue for pytest-rerunfailures.

PPA: https://launchpad.net/~cpete/+archive/ubuntu/pytest

pytest autopkgtest results: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-cpete-pytest/oracular/amd64/p/pytest/20240607_173550_99668@/log.gz

python-flaky autopkgtest results: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-cpete-pytest/oracular/amd64/p/python-flaky/20240607_173242_a6c20@/log.gz

[1] https://github.com/pytest-dev/pytest/pull/12436
[2] https://github.com/pytest-dev/pytest-rerunfailures/commit/0ab54f00d68bb4feadae58d2f4e30f6663495571