Repository navigation
Fixed #24522 -- Added a --shuffle option to DiscoverRunner. - #14137
Conversation
9d1a449 to
61fc7c7
Compare
61fc7c7 to
26b01ff
Compare
|
Resolved conflicts following: #14145 |
26b01ff to
4e79cf6
Compare
4e79cf6 to
5ec1583
Compare
|
Rebased. |
felixxm
left a comment
There was a problem hiding this comment.
@cjerdonek Thanks 👍 Looks great 🚀
|
I also wonder if can we do anything to make it easier to find a set of tests with an isolation issue, e.g. I really tried but couldn't find a reason for this error. |
|
In most of cases isolation issue is caused by a test from the same class, but you must to run them in a specific order that is generated only if you call $ ./runtests.py migrations.test_commands.MigrateTests.test_showmigrations_unmigrated_app migrations.test_commands.MigrateTests.test_migrate_with_system_checks --parallel=1
Testing against Django installed in '/django/django'
Found 2 tests.
Creating test database for alias 'default'...
Creating test database for alias 'other'...
System check identified no issues (0 silenced).
.E
======================================================================
ERROR: test_migrate_with_system_checks (migrations.test_commands.MigrateTests)
----------------------------------------------------------------------
... |
|
Thanks for your good comments, @felixxm!
Do you mean making it easier to find some new error in the test suite, or do you mean, once you do have some error, making it easier to find a minimal set of tests causing that same error? |
The second one, finding a minimal set of tests. In most of causes the order of the tests is crucial, so you need to have the same order but you don't need to run all tests. In described case it was enough to run tests in the same class (see #14300). Nevermind (grumbling... 😄 ) , let's do not complicate it, I can always grep output, etc. |
|
Ah, I actually think I might know just the solution for this (learned from another context). But just to clarify, is one of the issues that when you restrict to a smaller set of tests, the order changes, even if you use the same shuffle seed? |
Yes. |
|
Okay, so this is the idea that might be worth using then: https://arxiv.org/abs/1808.10016 It's called "consistent sampling." It's not too hard to implement and has that property (order is preserved when restricted to any subset). It might be better to do separately in a subsequent PR. |
Yes, this is a separate issue, |
ab422fe to
6b97061
Compare
|
@felixxm I went ahead and implemented the consistent sampling now because it requires a slightly incompatible API (the shuffler's |
519c4d9 to
27087fc
Compare
27087fc to
117bc9d
Compare
|
Thanks a lot for the review and comments, @adamchainz. I addressed each of your comments by either replying with an explanation or making your suggested edits in the code. |
|
FYI, I found a bug in other code while trying out this PR: |
5a66d1d to
c1274ff
Compare
|
Resolved conflicts. |
c4da4ac to
1fb4d77
Compare
|
Thanks for all your review comments, @felixxm. I incorporated all of them (unless I missed something, which I don't think I did). |
There was a problem hiding this comment.
I moved this class to a separate file.
1fb4d77 to
90ba716
Compare
|
@cjerdonek Many thanks 🚀 🏆 |
https://code.djangoproject.com/ticket/24522