Fix sendinput hanging forever when connection is blocked #207
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.
Hello
We have an issue since we bumped from
v1.3.2
tov1.3.3
in our unit tests.We have a test where we send a command to a device and expect it to fail with a timeout (we try to simulate a device experiencing a connection issue and not responding anymore). The test was working before and now hang infinitely.
I reproduced the test case in
v1.3.2
where we send the commandshow running-config
and Scrapligo can only read back a part of the output.Here the test case executed against commit
v1.3.2
(commit:a6c4329
)Here the same test case executed against commit
v1.3.3
(commit:7ea22c0
)I think this is caused by this call to
r := <-cr
because it doesn't take into account the timeout of the context.I don't know / understand the full implication of my proposal but this pull-request would fix our specific use case: