Skip to content

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

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

Closed
Eclips4 opened this issue Jul 1, 2024 · 1 comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@Eclips4
Copy link
Member

Eclips4 commented Jul 1, 2024

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

@Eclips4 Eclips4 added type-feature A feature request or enhancement tests Tests in the Lib/test dir labels Jul 1, 2024
vstinner pushed a commit that referenced this issue Jul 1, 2024
…21221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests
@vstinner
Copy link
Member

vstinner commented Jul 1, 2024

Done by c7991cc

@vstinner vstinner closed this as completed Jul 1, 2024
Akasurde pushed a commit to Akasurde/cpython that referenced this issue Jul 3, 2024
…vy (python#121221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…vy (python#121221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…vy (python#121221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants