diff options
author | Damien George <damien@micropython.org> | 2025-08-26 17:28:26 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-09-08 11:07:36 +1000 |
commit | b3c8ed6c33fa237c2061b38b31060a7fd3559810 (patch) | |
tree | 7110eaddb54f6cb4ab177ffa36e4a533836c3129 /tests/run-tests.py | |
parent | 9939565d50acfcd68429e86b6276a590197db951 (diff) |
tests/ports/rp2: Decrease test lower bound for thread lightsleep time.
This makes the rp2-specific lightsleep test more lenient, so it passes.
This test was added in PR #16454 / 69993daa5c2eae6055f0b3b2330e95e78d6e3738
and even back then it did not pass reliably on RP2040. The issue is that
threads can race each other to enter lightsleep mode, and when one of them
actually stops the CPU clock the other thread is stopped as well.
Depending on whether the other thread was just entering or just exiting
lightsleep itself, the total duration of all sleeps can vary and can be as
small as 2*T.
Therefore, adjust the minimum to allow 2*T.
`machine.lightsleep()` is anyway 1) specified only to wait at most the
given time; and 2) not well specified when multiple threads call it at the
same time. So it seems OK to make the test more lenient.
Work done in collaboration with @projectgus.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/run-tests.py')
0 files changed, 0 insertions, 0 deletions