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

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

Activity

  1. added
    type-featureA feature request or enhancement
    testsTests in the Lib/test dir
    on Jul 1, 2024
  2. added a commit that references this issue on Jul 1, 2024
  3. vstinner commented on Jul 1, 2024

    @vstinner
    Member

    Done by c7991cc

  4. added a commit that references this issue on Jul 3, 2024
  5. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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