circuitpython/tests/thread
Damien George b070765427 tests/thread: Allow thread tests to pass with the native emitter.
The native emitter will not release/bounce the GIL when running code, so
if it runs tight loops then no other threads get a chance to run (if the
GIL is enabled).  So for the thread tests, explicitly include a call to
`time.sleep(0)` (or equivalent) to bounce the GIL and give other threads a
chance to run.

For some tests (eg `thread_coop.py`) the whole point of the test is to test
that the GIL is correctly bounced.  So for those cases force the use of the
bytecode emitter for the busy functions.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-23 11:37:00 +10:00
..
disable_irq.py rp2: Fix recursive atomic sections when core1 is active. 2024-06-25 11:01:25 +10:00
disable_irq.py.exp rp2: Fix recursive atomic sections when core1 is active. 2024-06-25 11:01:25 +10:00
mutate_bytearray.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
mutate_dict.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
mutate_instance.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
mutate_list.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
mutate_set.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
stress_aes.py tests/thread/stress_aes.py: Reduce test time on PC targets. 2025-07-23 11:02:21 +10:00
stress_create.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
stress_heap.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
stress_recurse.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
stress_schedule.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
stress_schedule.py.exp py/scheduler: Add assert that scheduler is locked when unlocking. 2020-04-13 21:55:47 +10:00
thread_coop.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_coop.py.exp esp32/mpthreadport: Fix uneven GIL allocation between Python threads. 2024-07-23 12:33:19 +10:00
thread_exc1.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_exc2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_exc2.py.exp tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
thread_exit1.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_exit2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_gc1.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_heap_lock.py py/gc: Make gc_lock_depth have a count per thread. 2021-05-10 13:07:16 +10:00
thread_heap_lock.py.exp py/gc: Make gc_lock_depth have a count per thread. 2021-05-10 13:07:16 +10:00
thread_ident1.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_lock1.py all: Fix spelling mistakes based on codespell check. 2023-04-27 18:03:06 +10:00
thread_lock2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_lock3.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_lock4_intbig.py tests/thread: Rename thread_lock4 test to thread_lock4_intbig. 2025-07-18 00:11:34 +10:00
thread_lock5.py esp32/mpthreadport: Use binary semaphore instead of mutex. 2021-05-08 22:47:03 +10:00
thread_qstr1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_shared1.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_shared2.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_sleep1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_sleep2.py tests/thread: Add a test for accuracy of sleep within a thread. 2024-01-05 10:35:34 +11:00
thread_stacksize1.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00
thread_start1.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_start2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_stdin.py tests/thread: Allow thread tests to pass with the native emitter. 2025-07-23 11:37:00 +10:00