Skip to content

[weakref]: Consider marking test_threaded_weak_key_dict_copy and test_threaded_weak_value_dict_copy as cpu-heavy tests #121220

Closed
@Eclips4

Description

@Eclips4

Feature or enhancement

Proposal:

I'm wondering why the deepcopy version of these tests is marked as requires_resource('cpu') but they take almost the same amount of the time as the copy tests (test_weakref with enabled deepcopy and disabled copy tests takes about an 13 seconds, with enabled copy tests and disabled deepcopy tests takes about an 11 seconds)

Previously:

./python.exe -m test -q test_weakref
Using random seed: 1032227984
0:00:00 load avg: 1.24 Run 1 test sequentially in a single process

== Tests result: SUCCESS ==

Total duration: 11.7 sec
Total tests: run=137 skipped=2
Total test files: run=1/1
Result: SUCCESS

After marking these two tests as cpu-heavy:

./python.exe -m test -q test_weakref
Using random seed: 2063515471
0:00:00 load avg: 1.43 Run 1 test sequentially in a single process

== Tests result: SUCCESS ==

Total duration: 2.7 sec
Total tests: run=137 skipped=4
Total test files: run=1/1
Result: SUCCESS

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions