-
Notifications
You must be signed in to change notification settings - Fork 20
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
TDL - 16279 Implement request timeouts #55
Conversation
@patch('requests.Request', side_effect=Timeout) | ||
def test_connection_error_backoff(self, mocked_request, ConnectionError): |
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.
Update above test case as it's for ConnectionError
but you mocked the request to raise Timeout
. Also, you provided ConnectionError
as a mocked argument of time.sleep
.
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.
Updated.
# stream the bookmark is updated based on the last record. Thus the new state updated based | ||
# on stream. | ||
date_difference = (datetime.datetime.now() - datetime.datetime(2021, 10, 25, 00, 00, 00)).days | ||
timedelta_by_stream = {stream: [(date_difference if stream == 'answers' else 25), 0, 0] # {stream_name: [days, hours, minutes], ...} | ||
for stream in self.expected_streams()} |
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.
The answers
stream sets the bookmark as the date when the sync was run. However, after 25th October 2021, there was no record found for answers
stream. Hence, we altered the state to set a bookmark so that it never goes beyond 25th October, however for the forms
stream the bookmark is updated based on the last record. Thus the new state is updated based on the stream.
Description of change
Manual QA steps
Risks
Rollback steps