pytest-dev / pytest-rerunfailures

a pytest plugin that re-runs failed tests up to -n times to eliminate flakey failures
Other
380 stars 83 forks source link

set reruns does not work #265

Open yeego1 opened 7 months ago

yeego1 commented 7 months ago

I've already set --rerun 1, bug it does not work

pytest args: ['-n', '7', '--reruns', '1', '--dist', 'loadscope', 'test/xxxx/test_case/xxxxxx', '--alluredir', 'allure_report/xml', '--junitxml=output/result.xml']

class TestDebugRerun:

    def test_debug_rerun(self):
        logging.info("post request")
        assert False

=========================== short test summary info ============================ 2024-03-08 11:10:43.929 FAILED xxxxxxxxxx.py::TestDebugRerun::test_debug_rerun 2024-03-08 11:10:43.929 ============== 1 failed in xxxxxS (0:01:16) ==============

python==3.7 pytest==6.2.1 pytest-rerunfailures==12.0 pytest-xdist==3.5.0

If you could give me more help?

icemac commented 7 months ago

Which other pytest plug-ins do you have installed?

yeego1 commented 7 months ago

Which other pytest plug-ins do you have installed?

Yes

allure-pytest==2.8.6 pytest==6.2.1 pytest-assume==2.2.1 pytest-forked==1.1.3 pytest-html==2.1.0 pytest-metadata==1.8.0 pytest-ordering==0.6 pytest-rerunfailures==12.0 pytest-xdist==3.5.0 pytest-dependency==0.5.1 pytest-timeout==2.1.0

icemac commented 6 months ago

@yeego1 See https://github.com/pytest-dev/pytest-rerunfailures/issues/99 for a possible solution.

Please report back wether that helped.

yeego1 commented 6 months ago

@yeego1 See #99 for a possible solution.

Please report back wether that helped.

I tried the workaround and none of it worked, but I did it by lowering the reruns version to 9.1.1

icemac commented 6 months ago

So the breaking change has to be in https://github.com/pytest-dev/pytest-rerunfailures/compare/9.1.1...10.0 - if version 10.0 also does not work.

I am here to maintain the project, so I will not dive into the diff to find the issue.