Skip to content

run --follow --timeout SECONDS - #175

Merged
bdbarnett merged 1 commit into
mainfrom
fix/follow-timeout
Oct 28, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
fix/follow-timeout

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

`run --follow` used to give up whenever your script printed nothing for 10 seconds, because mpremote's `exec` waits a fixed 10 s for output and offers no way to change it. A script that prints a line and then works quietly for longer, an encode or a stream, failed with `timeout waiting for first EOF reception` while the board went on running it.

Now you can pass `--timeout SECONDS` to wait longer, or `--timeout 0` to wait until the script ends. The limit reaches the sidecar's `run_script` and `run_path` as a `timeout` param, and the follow calls mpremote's `exec_raw` with it. Without `--timeout`, nothing changes: the default is still 10 s. When the follow does time out, the error says how long the script was quiet and names `--timeout`.

`--timeout` without `--follow` is an error, since `run` then returns as soon as the script starts. Over an editor's RPC session, the client stops applying its own 120 s socket limit when you pass `--timeout`, so a long wait isn't cut short there.

The tests run the script from the issue (print, 20 s of quiet, print) against a fake board, and run the follow through the transport's real read loop with a short gap. The docs for `run`, the troubleshooting table and the changelog cover the option.

Fixes #172

@bdbarnett
bdbarnett merged commit ac340e2 into main Oct 28, 2026
8 checks passed
@bdbarnett
bdbarnett deleted the fix/follow-timeout branch October 28, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

run --follow: let me set how long to wait

1 participant