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

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jun 29, 2021

Supersedes #82
Supersedes #33
Fix #48
Related to #105

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.
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 cmaglie merged commit 01c367d into bugst:master Jun 29, 2021
@cmaglie cmaglie deleted the timeouts branch June 29, 2021 15:00
This was referenced Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeouts
1 participant