Skip to content

Mark slow test methods with @requires_resource('cpu') #108416

Closed
@serhiy-storchaka

Description

@serhiy-storchaka

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

Metadata

Metadata

Labels

testsTests in the Lib/test dir

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions