diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2022-09-13 16:40:34 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-09-13 17:41:02 +1000 |
| commit | 6c376a93067230b3b9d7d4adc1b804df18b12dcd (patch) | |
| tree | f3a86881591f117a4bc98020436544f06811c34c | |
| parent | 51b054dd66fcd4f26f965910ea25de85a2ea01a3 (diff) | |
tests/extmod/uasyncio_heaplock.py: Force SKIP on stackless.
This is a latent issue that wasn't caught by CI because there was no
configuration that had both stackless+uasyncio.
The previous check to skip with stackless builds only worked when the
bytecode emitter was used by default. Force the check to use the bytecode
emitter.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
| -rw-r--r-- | tests/extmod/uasyncio_heaplock.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/extmod/uasyncio_heaplock.py b/tests/extmod/uasyncio_heaplock.py index a6b4a0819..9c9487357 100644 --- a/tests/extmod/uasyncio_heaplock.py +++ b/tests/extmod/uasyncio_heaplock.py @@ -8,11 +8,19 @@ import micropython # strict stackless builds can't call functions without allocating a frame on the heap try: - f = lambda: 0 + # force bytecode (in case we're running with emit=native) and verify + # that bytecode-calling-bytecode doesn't allocate + @micropython.bytecode + def f(x): + x and f(x - 1) + micropython.heap_lock() - f() + f(1) micropython.heap_unlock() except RuntimeError: + # RuntimeError (max recursion depth) not MemoryError because effectively + # the recursion depth is at the limit while the heap is locked with + # stackless print("SKIP") raise SystemExit |
