-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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_free_threading and test_super take way to long on a Free Threaded build. #124402
Comments
We should definitely make |
@terryjreedy - were you testing with a build configured with |
Yes: |
There is also |
That's surprising. On Linux, on Python built in debug mode without any optimization ( |
test___class___modification_multithreaded() now requires the 'cpu' tets resource on Free Threaded build.
test___class___modification_multithreaded() now requires the 'cpu' tets resource on Free Threaded build.
test___class___modification_multithreaded() now requires the 'cpu' test resource on a Free Threaded build.
Oh ok, test_super takes a few minutes on a Free Threaded build: I created PR gh-124434 to skip the test unless the "cpu" test resource is enabled. |
Timing on Free Threaded builds. Linux: Python built in debug mode with
Windows: Python built with
|
Require the 'cpu' test resource on slow test_free_threading tests.
By the way, test_free_threading.test___class___modification() and test_super.test___class___modification_multithreaded() are the same test! |
Require the 'cpu' test resource on slow test_free_threading tests.
Yup that was my mistake. |
test___class___modification_multithreaded() now requires the 'cpu' test resource on a Free Threaded build.
…onGH-124434) test___class___modification_multithreaded() now requires the 'cpu' test resource on a Free Threaded build. (cherry picked from commit 5a60566) Co-authored-by: Victor Stinner <[email protected]>
Should we only keep the test in test_super? I'm not sure of the relationship between super() and the test. |
Ok. At least, tests are still run on buildbots, and skipping slowest tests for now should make GitHub Actions a little bit faster.
Got it. Is there a risk of not testing the bug anymore if the number of iterations/threads is too low? How can we tune these without missing the point of the test? |
I think there's some risk, but it's usually worth the tradeoff of catching bugs earlier. I'm more concerned about missing bugs in buildbots -- it's easier to miss occasional failures if the tests aren't run as part of |
I consider the current fixes to be perhaps temporary. On the one hand, the two tests increased the CI sequential test run times perhaps 50% and with the sprint on, PR CIs are backing up and taking 1 1/2 or more hours. An immediate fix was really needed. On the other hand, I think test_free_threading should get the same minute that other tests are allowed, and some take. But working out priorities and adjusting tests may need some days. |
Reduce the number of iterations and the number of threads so a whole test file takes less than a minute. Refactor test_racing_iter_extend() to remove two levels of indentation.
* Reduce the number of iterations and the number of threads so a whole test file takes less than a minute. * Refactor test_racing_iter_extend() to remove two levels of indentation. * test_monitoring() uses a sleep of 100 ms instead of 1 second.
I wrote a draft PR gh-124491 to remove |
* Reduce the number of iterations and the number of threads so a whole test file takes less than a minute. * Refactor test_racing_iter_extend() to remove two levels of indentation. * test_monitoring() uses a sleep of 100 ms instead of 1 second.
* Reduce the number of iterations and the number of threads so a whole test file takes less than a minute. * Refactor test_racing_iter_extend() to remove two levels of indentation. * test_monitoring() uses a sleep of 100 ms instead of 1 second.
… (#124585) gh-124402: Speed up test_free_threading and test_super (#124491) * Reduce the number of iterations and the number of threads so a whole test file takes less than a minute. * Refactor test_racing_iter_extend() to remove two levels of indentation. * test_monitoring() uses a sleep of 100 ms instead of 1 second. (cherry picked from commit 0387c34)
Any more planned PRs, or close? |
We're done, I closed the issue. |
Bug report
Running freshly updated and compiled main on my new machine,
python -m test -j0
(I forgot -ugui) ran all but 2 tests in 2:46. (16 cores defaulted to 2x16 + 2 == 34 processes.) The longest running was test_multiprocessing_spawn.test_processes at 2:18. But test_super took 10:13 and test_free_threading took 13:37. These both need to be broken up into one or more directories with multiple files in each, which each file running faster than the longest 'other' test. Several other tests, including multiprocessing have been broken up in the last year to allow testing to complete faster on multicore machines. (I don't know what label, if any, might be added for test_super.)Linked PRs
The text was updated successfully, but these errors were encountered: