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

test_sources_update triggers flaky code or is a flaky test #2119

Open
sten0 opened this issue Nov 4, 2024 · 6 comments
Open

test_sources_update triggers flaky code or is a flaky test #2119

sten0 opened this issue Nov 4, 2024 · 6 comments
Assignees
Labels
priority:medium Non-critical improvement to functionality or usability type:bug Something doesn't work as intended

Comments

@sten0
Copy link
Contributor

sten0 commented Nov 4, 2024

My desktop and laptop aren't fast enough to reproduce the issue locally, but test_sources_update "regularly fails" on half of Debian's CI, reproducibility, and regression testing networks. The Release Team now considers this a serious (release critical) issue. https://bugs.debian.org/1086524

Here is a recent log for 0.10.0-beta1 on arm64:
https://tests.reproducible-builds.org/debian/logs/experimental/arm64/vorta_0.10.0~beta1-1~exp1.build2.log.gz

The dashboard (with logs) for all Reproducibility Builds is available here:
https://tests.reproducible-builds.org/debian/rb-pkg/experimental/arm64/vorta.html

The main dashboard for the CI network is here:
https://ci.debian.net/packages/v/vorta/

Please note that you actually need to click on a particular version under one of the four columns in order to access the CI and regression-testing history for that suite. The nature of the problem Paul Gevers reported is logged on each arch under "testing"; this is where we prepare for the next stable Debian release. Unstable tracks the latest stable version and/or the latest version believed to not have any release critical issues (ie crashes, data loss). Attempts to migrate the experimental version to unstable are also logged here.

All details about environment are also logged; please let me know if you have any questions about interpreting them.

@m3nu
Copy link
Contributor

m3nu commented Nov 8, 2024

Hard to address this, if it's not reproducible and the error doesn't happen in our code. I see the test does some patching with Qt widgets, that may cause the crashes elsewhere.

I'll remove those tests for now, until someone has time to redo them.

Since most feedback for 0.10 beta is also covered, I'll do a release for it shortly.

@sten0
Copy link
Contributor Author

sten0 commented Nov 10, 2024 via email

@m3nu m3nu added type:bug Something doesn't work as intended priority:medium Non-critical improvement to functionality or usability labels Nov 10, 2024
@m3nu m3nu self-assigned this Nov 10, 2024
@m3nu
Copy link
Contributor

m3nu commented Nov 10, 2024

Upon looking into it more, the error in the logs would point to QThreads fetching file stats that are still running after the test. We take some care in ending those QThreads when they run as background task, but not when refreshing the stats of source folders. So this likely triggers the error. Solution is just to mock those threads in the test, so the don't even start or make sure they are done after the test.

I'm adding some details here so this can be addressed soon. For now I've just disabled those tests to get a release out and test this theory in Debian's CI.

tests/unit/test_source.py::test_valid_and_invalid_source_paths[file:///build/reproducible-path/vorta-0.10.0~beta1/.pybuild/cpython3_3.12_vorta/build/tests/unit/test_source.py/build/reproducible-path/vorta-0.10.0~beta1/.pybuild/cpython3_3.12_vorta/build/tests/unit/test_source.py-False] PASSED
tests/unit/test_source.py::test_sources_update QThread: <<<Destroyed while thread is still running>>>
Fatal Python error: Aborted

Thread 0x0000ffff8efdf180 (most recent call first):
  <no Python frame>

Thread 0x0000ffff8dbcf180 (most recent call first):
  <no Python frame>

@sten0
Copy link
Contributor Author

sten0 commented Nov 11, 2024 via email

@sten0
Copy link
Contributor Author

sten0 commented Nov 20, 2024

Hi @m3nu, could you take a look at my previous message when you have a moment?

@m3nu
Copy link
Contributor

m3nu commented Nov 21, 2024

Apologies. I didn't see the sentence in the middle due to formatting of the email.

And yes, the source folder tests mostly test getting stats for source folders using QThreads. So the UI isn't blocked, since this can take a long time. My theory would be that some of those QThreads survive after the test and cause the crashes you see in some situations.

For now I've disabled those tests. Best would be to mock the background threads and only test the function they use directly. I assume we partly do this already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:medium Non-critical improvement to functionality or usability type:bug Something doesn't work as intended
Projects
None yet
Development

No branches or pull requests

2 participants