-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Improve timeout handling in OutboundMessageListener #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure about the logic.
messageHandler is the best place to keep track of when data was last received, with read() setting an initial value of “now” for that variable. When data is received, update that variable
Read can then do two checks
(1) has total time exceeded max time
(2) has difference between “now” and dataLastReceived exceeded transientWaitMillis
chnages are done |
@gkc please review my unit tests whether they cover all the scenarios and whether the tests make sense |
@@ -177,4 +177,65 @@ void main() { | |||
expect(response, 'stream:@bob:phone@alice'); | |||
}); | |||
}); | |||
|
|||
group('A group of tests to verify AtTimeOutException', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Main thing missing now is tests where we start a read, then we send data in chunks to the messageHandler but with delays ('await Future.delayed(Duration(xxx))`) of various lengths in between, and check both positive and negative scenarios over longer durations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added two tests
- A test to verify full response received - delay between messages from server
- A test to verify timeout - delay between messages from server
Please check whether this is inline with what you expected.
Will try to add more tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
draft PR to check at client tests with current changes in at_lookup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I see all tests passing in at_client_sdk using this branch (atsign-foundation/at_client_sdk#605) so I think we're good to go
- What I did
- How I did it
- How to verify it
Run the unit test group - A group of tests to verify AtTimeOutException in outbound_message_listener.dart