Description
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Proposal:
The proposed PR marks all test methods which have duration longer than 3 seconds with @test.support.requires_resource('cpu')
decorator.
The purpose is to reduce manual testing time. It happens that all tests in a file are ran in fraction of a second, but few tests take a long time to run. When you work on some large feature or bugfix you need to run corresponding tests multiple times. You can exclude the slowest tests manually, but you should know what of them are culprits. When they are marked as CPU-hungry, you can just not enable the "cpu" resource.
For example, all test_math
takes over 1.5 minutes to finish. But when exclude test_sumprod_stress
, it takes only 3 seconds.
Linked PRs
- gh-108416: Mark slow test methods with @requires_resource('cpu') #108421
- gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') #108480
- [3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) #108798
- [3.11] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) #108799
- [3.12] gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480) #108923
- [3.11] gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480) #108924