Skip to content

Suggest marking test_free_threading.test_dict as a heavy-cpu test #119599

Closed
@Eclips4

Description

@Eclips4

Bug description:

On my machine (macbook air M1) single run of test_free_threading takes about two minutes:

./python.exe -m test -q test_free_threading
Using random seed: 1314296093
0:00:00 load avg: 1.62 Run 1 test sequentially
test_free_threading passed in 1 min 42 sec

== Tests result: SUCCESS ==

Total duration: 1 min 42 sec
Total tests: run=19
Total test files: run=1/1
Result: SUCCESS

Refleak tests takes much longer time:

./python.exe -m test -R 3:3 test_free_threading
Using random seed: 1878526610
0:00:00 load avg: 2.82 Run 1 test sequentially
0:00:00 load avg: 2.82 [1/1] test_free_threading
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XX. ...
test_free_threading passed in 9 min 54 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 9 min 54 sec
Total tests: run=19
Total test files: run=1/1
Result: SUCCESS

But if we apply requires("cpu") decorator to the test_dict.TestDict, time for the refleak tests reduces to ~3 minutes:

./python.exe -m test -R 3:3 test_free_threading
Using random seed: 2985174183
0:00:00 load avg: 1.94 Run 1 test sequentially
0:00:00 load avg: 1.94 [1/1] test_free_threading
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XXX .2.
test_free_threading leaked [0, 2, 0] memory blocks, sum=2 (this is fine)
test_free_threading passed in 2 min 54 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 2 min 54 sec
Total tests: run=14 skipped=1
Total test files: run=1/1
Result: SUCCESS

FYI, this is a debug, non free-threaded build.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions