Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of read timeouts #109

Merged
merged 4 commits into from
Jun 29, 2021
Merged

Implementation of read timeouts #109

merged 4 commits into from
Jun 29, 2021

Commits on Jun 29, 2021

  1. windows: correcly signal PortClosed error on blocked Read()

    This commit fix regression test TestConcurrentReadAndWrite.
    
    Even if the test checks purpose is another it has detected
    anyway that the returned error is incorrect.
    
    Another specific test for closing port detection will be added
    in the future.
    cmaglie committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    f355dbf View commit details
    Browse the repository at this point in the history
  2. linux: detect port disconnection during Read

    See https://stackoverflow.com/a/34945814/1655275
    
    > pselect signals that file descriptor is ready and
    > ioctl(fd, FIONREAD, &len) returns zero len.
    
    Failure to detect this condition has been revealed by
    the testsuite:
    
    === RUN   TestDisconnectingPortDetection
    2017/07/27 13:56:37 PR - Connecting to Probe
    2017/07/27 13:56:37      > Searching for port 2341:8037
    2017/07/27 13:56:37        Detected port '/dev/ttyACM0' 2341:8037
    2017/07/27 13:56:37        Using '/dev/ttyACM0'
    2017/07/27 13:56:37 Starting test (timeout 20s)
    2017/07/27 13:56:37 PR - Turn ON target
    2017/07/27 13:56:37 TR - Connecting to Target
    2017/07/27 13:56:37      > Searching for port 2341:8036
    2017/07/27 13:56:37        Detected port '/dev/ttyACM0' 2341:8037
    [...cut...]
    2017/07/27 13:56:46      > Searching for port 2341:8036
    2017/07/27 13:56:46        Detected port '/dev/ttyACM0' 2341:8037
    2017/07/27 13:56:46        Detected port '/dev/ttyACM1' 2341:8036
    2017/07/27 13:56:46        Using '/dev/ttyACM1'
    2017/07/27 13:56:46 T2 - Make a Read call
    2017/07/27 13:56:46 T1 - Delay 200ms before disconnecting target
    2017/07/27 13:56:46 T1 - Disconnect target
    2017/07/27 13:56:46 PR - Turn OFF target
    2017/07/27 13:56:46 T2 - Read returned: n=0 err=nil
    --- FAIL: TestDisconnectingPortDetection (9.18s)
            Error Trace:    serial_test.go:100
    	Error:		An error is expected but got nil. %s
    	Messages:	Read returned no errors
    
    this commit fix the problem above.
    cmaglie committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    a63b288 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2cb14f0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    23dbc8b View commit details
    Browse the repository at this point in the history