tests/thread: Re-enable GC before stress_schedule test ends.

Otherwise GC stays disabled (not re-enabled by soft reset) and later test
runs fail with MemoryError.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton 2024-06-12 19:07:14 +10:00 committed by Damien George
parent 407464348d
commit 5a778ebc37
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,8 @@ while n < _NUM_TASKS and time.ticks_diff(time.ticks_ms(), t) < _TIMEOUT_MS:
thread_run = False
time.sleep_ms(20)
gc.enable()
if n < _NUM_TASKS:
# Not all the tasks were scheduled, likely the scheduler stopped working.
print(n)