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

Unit test suite run ends with a segmentation fault (Python 3.9) #1514

Closed
gonzalo-bulnes opened this issue Jun 8, 2022 · 0 comments · Fixed by #1515
Closed

Unit test suite run ends with a segmentation fault (Python 3.9) #1514

gonzalo-bulnes opened this issue Jun 8, 2022 · 0 comments · Fixed by #1515
Assignees
Labels

Comments

@gonzalo-bulnes
Copy link
Contributor

gonzalo-bulnes commented Jun 8, 2022

Description

After the unit test suite (make test) successfully runs and the coverage report is displayed, a segmentation fault happens that causes the script to fail.

Steps to Reproduce

For some reason that I don't understand, I cannot reproduce this on Python 3.7, but it does happen very often in Python 3.9.

If you need to create an adequate Python 3.9 environment:

# Create an adequate Python 3.9 virtual environment:
git checkout update-dev-deps-to-match-bullseye-env
python3.9 -m venv .venv
source .venv/bin/activate
pip install --require-hashes -r requirements/dev-requirements.txt
git checkout -

Simple but long version to reproduce the errors:

# Run the unit test suite:
make test

Sorter version, but requires you to confirm that the reproduction command is actually equivalent to make test:

# Run a few times, it will segfault roughly half the time:
python -m pytest -v --junitxml=test-results/junit.xml tests/gui/test_actions.py::TestDownloadConversation::test_gets_initially_disabled_when_file_information_is_available tests/gui/test_main.py::test_show_main_window_when_already_showing

Note: When running only a few tests, the segmentation faults are not systematic. make test does error very often, though, I believe it's because if we run enough tests, the probability of any of them causing the segmentation fault increases dramatically. (See Comments section below.)

Expected Behavior

When there are no test failures, the make test succeeds under any version of Python.

Actual Behavior

Under Python 3.9 (at least, other versionsmay be affected as well): after the unit test suite (make test) successfully runs and the coverage report is displayed, a segmentation fault happens that causes the script to fail.

Comments

First mentions

This issue was first reported in #1512 (comment) and #1496 (comment)

Noteworthy behavior

While running tests (as little as two) from different test files causes the error, it is noteworthy than running multiple tests from a single test file doesn't.

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

Successfully merging a pull request may close this issue.

1 participant