Skip to content

Tests: test_fail_and_continue_with_stepwise is flaky #4366

@blueyed

Description

@blueyed

Seen it before already, and here it is again:

https://ci.appveyor.com/project/pytestbot/pytest/builds/20191315/job/431p82b80ai2je82#L148

Seems to be related to xdist. TOXENV=py27-trial,py27-numpy,py27-nobyte in this case.

================================== FAILURES ===================================
____________________ test_fail_and_continue_with_stepwise _____________________
[gw1] win32 -- Python 2.7.15 c:\projects\pytest\.tox\py27-nobyte\scripts\python.exe
stepwise_testdir = <Testdir local('c:\\users\\appveyor\\appdata\\local\\temp\\1\\pytest-of-appveyor\\pytest-2\\popen-gw1\\test_fail_and_continue_with_stepwise0')>
    def test_fail_and_continue_with_stepwise(stepwise_testdir):
        # Run the tests with a failing second test.
        result = stepwise_testdir.runpytest("-v", "--strict", "--stepwise", "--fail")
        assert not result.stderr.str()
    
        stdout = result.stdout.str()
        # Make sure we stop after first failing test.
        assert "test_success_before_fail PASSED" in stdout
        assert "test_fail_on_flag FAILED" in stdout
        assert "test_success_after_fail" not in stdout
    
        # "Fix" the test that failed in the last run and run it again.
        result = stepwise_testdir.runpytest("-v", "--strict", "--stepwise")
        assert not result.stderr.str()
    
        stdout = result.stdout.str()
        # Make sure the latest failing test runs and then continues.
>       assert "test_success_before_fail" not in stdout
E       AssertionError: assert 'test_success_before_fail' not in '============================= test session starts =============================\nplatform win32 -- Python 2.7.15, pyte...                              [100%]\n\n========================== 6 passed in 0.08 seconds ===========================\n'
C:\projects\pytest\testing\test_stepwise.py:95: AssertionError
---------------------------- Captured stdout call -----------------------------
============================= test session starts =============================
platform win32 -- Python 2.7.15, pytest-3.10.1.dev65+g9d11428a, py-1.7.0, pluggy-0.8.0 -- c:\projects\pytest\.tox\py27-nobyte\scripts\python.exe
cachedir: C:\projects\pytest\.tox\py27-nobyte\.pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('C:\\projects\\pytest\\.hypothesis\\examples')
rootdir: c:\users\appveyor\appdata\local\temp\1\pytest-of-appveyor\pytest-2\popen-gw1\test_fail_and_continue_with_stepwise0, inifile:
plugins: xdist-1.24.0, forked-0.2, hypothesis-3.82.1
collecting ... collected 6 items
test_a.py::test_success_before_fail PASSED                               [ 16%]
test_a.py::test_fail_on_flag FAILED                                      [ 33%]
================================== FAILURES ===================================
______________________________ test_fail_on_flag ______________________________
request = <FixtureRequest for <Function 'test_fail_on_flag'>>
    def test_fail_on_flag(request):
>       assert not request.config.getvalue('fail')
E       AssertionError: assert not True
E        +  where True = <bound method Config.getvalue of <_pytest.config.Config object at 0x0566DA70>>('fail')
E        +    where <bound method Config.getvalue of <_pytest.config.Config object at 0x0566DA70>> = <_pytest.config.Config object at 0x0566DA70>.getvalue
E        +      where <_pytest.config.Config object at 0x0566DA70> = <FixtureRequest for <Function 'test_fail_on_flag'>>.config
test_a.py:5: AssertionError
!!!!!!!! Interrupted: Test failed, continuing from this test next run. !!!!!!!!
===================== 1 failed, 1 passed in 0.17 seconds ======================
============================= test session starts =============================
platform win32 -- Python 2.7.15, pytest-3.10.1.dev65+g9d11428a, py-1.7.0, pluggy-0.8.0 -- c:\projects\pytest\.tox\py27-nobyte\scripts\python.exe
cachedir: C:\projects\pytest\.tox\py27-nobyte\.pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('C:\\projects\\pytest\\.hypothesis\\examples')
rootdir: c:\users\appveyor\appdata\local\temp\1\pytest-of-appveyor\pytest-2\popen-gw1\test_fail_and_continue_with_stepwise0, inifile:
plugins: xdist-1.24.0, forked-0.2, hypothesis-3.82.1
collecting ... collected 6 items
test_a.py::test_success_before_fail PASSED                               [ 16%]
test_a.py::test_fail_on_flag PASSED                                      [ 33%]
test_a.py::test_success_after_fail PASSED                                [ 50%]
test_a.py::test_fail_last_on_flag PASSED                                 [ 66%]
test_a.py::test_success_after_last_fail PASSED                           [ 83%]
test_b.py::test_success PASSED                                           [100%]
========================== 6 passed in 0.08 seconds ===========================
=========================== short test summary info ===========================
FAIL testing/test_stepwise.py::test_fail_and_continue_with_stepwise

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressedtype: infrastructureimprovement to development/releases/CI structure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions