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

Run the test suite in a random order #2287

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

matrss
Copy link
Collaborator

@matrss matrss commented Mar 19, 2024

Fixes #2192.

Depends on #2249.

@matrss matrss force-pushed the test-in-random-order branch 3 times, most recently from 33c548d to f5c0894 Compare March 21, 2024 09:55
@matrss matrss force-pushed the test-in-random-order branch 2 times, most recently from 91df126 to b420380 Compare March 21, 2024 16:50
@matrss
Copy link
Collaborator Author

matrss commented Mar 21, 2024

I've again tested how reliable this is: https://github.com/Open-MSS/MSS/actions/runs/8376494045/job/22936321858. Most runs passed, but two didn't. One of them ran into the 60 second pytest timeout, the other reached the 20 minute step timeout. I think this is just a symptom of the macOS 13 runners being very much all over the place in terms of performance (runtimes vary between ~8 and ~14 minutes for the jobs that passed as well). I also think that this problem is unrelated to this PR, and could happen on current develop also.

This does decrease coverage a bit, because it disables problematic tests that previously passed by chance, when running in normal and reverse order on linux.

@matrss matrss marked this pull request as ready for review March 21, 2024 16:59
@matrss matrss requested a review from ReimarBauer March 21, 2024 17:01
@matrss matrss force-pushed the test-in-random-order branch 2 times, most recently from f93367b to b420380 Compare March 21, 2024 17:09
@@ -29,6 +28,7 @@ jobs:
sed -e "s/menuinst.*//" |
sed -e "s/.*://" > requirements.tmp.txt
cat requirements.d/development.txt >> requirements.tmp.txt
echo "pytest-randomly" >> requirements.tmp.txt
Copy link
Member

@ReimarBauer ReimarBauer Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We maybe should add this to the https://github.com/Open-MSS/MSS/blob/develop/requirements.d/development.txt

or does it once it is installed immeadiatly change to randomly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, once it is installed it will randomize the test order by default, unless you pass --randomly-dont-reorganize. That is why I decided to only add it in this workflow, until the test suite fully works with it.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

@matrss matrss merged commit 30bd36a into Open-MSS:develop Mar 27, 2024
21 of 22 checks passed
@matrss matrss deleted the test-in-random-order branch March 27, 2024 12:40
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.

Add pytest-randomly to randomize test execution
2 participants