Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest-timeout is not working as expected when pytest-rerunfailures is enabled #7581

Closed
xoriole opened this issue Aug 22, 2023 · 2 comments
Closed

Comments

@xoriole
Copy link
Contributor

xoriole commented Aug 22, 2023

pytest-timeout is not working well with pytest-rerunfailures.
See: pytest-dev/pytest-timeout#18

Because of this, the default timeout of 60 seconds is not applied on the tests and sometimes some tests get stuck for several minutes resulting in GitHub action's execution timeout of 10 minutes.

One of the such tests is test_check_and_regen_personal_channel_torrent_sleep which was stuck for approx 8 minutes.
Logs here: https://github.com/Tribler/tribler/actions/runs/5937813183/job/16103116115?pr=7575

Link might not be available for long so here is the relevant logs snippet:

...
Tue, 22 Aug 2023 12:08:22 GMT
12:08:22.908 Starting "test_check_channels_updates"...
Tue, 22 Aug 2023 12:08:23 GMT
src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager.py::test_check_channels_updates PASSED [ 26%] in 0.204s (a minute in total)
Tue, 22 Aug 2023 12:08:23 GMT
12:08:23.112 Starting "test_check_and_regen_personal_channel_torrent_sleep"...
Tue, 22 Aug 2023 12:16:12 GMT
src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager.py::test_check_and_regen_personal_channel_torrent_sleep 
Tue, 22 Aug 2023 12:16:12 GMT
Error: The operation was canceled.

So, I would be in favor of disabling pytest-rerunfailures so we can find out the tests which are getting stuck and fix them properly.

@drew2a
Copy link
Collaborator

drew2a commented Oct 16, 2023

The example provided in the issue works well with reruns == 0

@pytest.mark.timeout(2)
@pytest.mark.flaky(0)
def test_new():
    time.sleep(10)
    assert True

Perhaps if we run our tests with this argument, pytest-sentry will work as expected (this statement needs verification by doing an experiment).

The tests should be run with the following env:

PYTEST_SENTRY_ALWAYS_REPORT=1.

@drew2a
Copy link
Collaborator

drew2a commented Nov 9, 2023

Seems that we still have tests that could not be stopped by pytest-timeout although the pytest-rerunfailures is disabled.

https://github.com/Tribler/tribler/actions/runs/6812737385/job/18525760881?pr=7685

The test_download_unknown_state test has been stuck for almost 10 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants