Skip to content

Commit 46b723d

Browse files
committed
wipe micropython device before tests
1 parent e97360b commit 46b723d

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/micropython.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
run: |
1818
$HOME/actions-runner/.venv/bin/pip install -e .
1919
$HOME/actions-runner/.venv/bin/pip install uhttp-client
20+
$HOME/actions-runner/.venv/bin/pip install 'mpytool>=2.4.0'
2021
2122
- name: MicroPython tests (${{ matrix.device }})
2223
run: |

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
run: |
6666
$HOME/actions-runner/.venv/bin/pip install -e .
6767
$HOME/actions-runner/.venv/bin/pip install uhttp-client
68+
$HOME/actions-runner/.venv/bin/pip install 'mpytool>=2.4.0'
6869
6970
- name: MicroPython tests (${{ matrix.device }})
7071
run: |

tests/test_mpy_integration.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,10 @@ def setUpClass(cls):
109109
cls.conn = mpytool.ConnSerial(port=PORT, baudrate=115200)
110110
cls.mpy = mpytool.Mpy(cls.conn)
111111

112-
# Soft reset to clear any previous state
113-
cls.mpy.stop()
114-
try:
115-
cls.conn.write(b'\x03\x03\x04') # Ctrl-C twice + Ctrl-D
116-
time.sleep(2)
117-
cls.conn.read_all()
118-
except Exception:
119-
pass
120-
cls.mpy.stop()
112+
# Wipe filesystem and machine-reset to drop any leftover state
113+
# (open sockets, WiFi, mounted VFS, files) from a previous run.
114+
# Soft reset alone does not free runtime resources.
115+
cls.mpy.wipe()
121116

122117
# Mount server module with mpy-cross compilation
123118
server_dir = Path(__file__).parent.parent / 'uhttp'

0 commit comments

Comments
 (0)