Repository navigation
run --follow --timeout SECONDS - #175
Merged
Merged
Conversation
…to wait until it ends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
`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