Skip to content

Fix issues with concurrent testing - #995

Open
AHSauge wants to merge 7 commits into
Murmele:masterfrom
AHSauge:fix/concurrent-tests
Open

Fix issues with concurrent testing#995
AHSauge wants to merge 7 commits into
Murmele:masterfrom
AHSauge:fix/concurrent-tests

Conversation

@AHSauge

@AHSauge AHSauge commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This fixes six issues causing intermittent failure in the test cases

  1. System.lua is created and destroyed at run-time at in the same temp location. Now the file is just patched in-memory instead, when necessary, avoiding this clash between test cases
  2. Some test cases don't write to a temporary directory. Quite frankly I don't see the use-case for testing without a per-process temporary directory, so the option is just removed
  3. All test cases read and write to the same settings, which very inconveniently is the user settings. Now they all write to a per-process temporary directory. If a test case crash, you're no longer stuck with a cluttered user settings and recent repos.
  4. Occasionally MainWindow is being reused in the Submodule test code. This cause crashes since particularly the repo directory might be gone and invalid in the next test case.
  5. There's a potential use-after-free in a future started by CommitModel
  6. On Windows, the TreeView test case is prone to fail. I got Claude to debug this for me, but there seems to be a missing wait-for-refresh in the TreeView test code. I've copied some wait code use elsewhere in the test code to wait for a QAbstractItemModel object to be fully refreshed.

I've been running this quite a few times, and ctest -jN (N for example being 32) no longer seem to fail. Typically, particularly the TreeView test case was prone to fail, and we've seen this in the GitHub CI/CD pipeline for Windows. I'm pretty confident this will fix those problem.

Added bonus is that the test cases run far faster in parallel, and it has no chance to mess up the user settings if it crashes.

Fixes #546
Fixes #769

This bypasses the need to even write System.lua by feeding it in-memory when we patch it
This prevents test cases failing due to clashing file access
This should finally allow test cases to safely run in parallel
@AHSauge

AHSauge commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

As anyone following this PR will have seen, the initial fixes still didn't resolve all the intermittent failures. After a bit more debugging on Windows, I think I've ironed out the remaining issues. The challenge here is that different builds (debug vs release), platforms, concurrency, and timing all play a part in when and how these things get triggered. Both debug and release on Fedora 44 (on HW) in addition to debug on a Windows VM seems to work now, so I'm just going 🤞 and hope this was all.

devwolf75 added a commit to devwolf75/Gittyup-Windows that referenced this pull request Aug 25, 2026
Fixes flaky TreeView failures on Windows CI (backport of the relevant
part of Murmele#995).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source directory being used for theme files again, panic at runtime Build Error (Arch Linux - current aur version)

1 participant