New GitHub issue #119599 from Eclips4:<br>
<hr>
<pre>
### Bug description:
On my machine (macbook air M1) single run of ``test_free_threading`` takes about two minutes:
```python
./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
./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 refleak tests reduces to ~3 minutes:
```python
./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
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/119599">View on GitHub</a>
<p>Labels: tests, topic-free-threading</p>
<p>Assignee: </p>