fix: More robust connections to telemetry backend#1289
Conversation
- Increase read timeout to 100ms. Backend needs a bit more time than 1ms to reliably receive & process data - Don't crash if offline - Integration tests to validate offline behavior & opt-in/opt-out behavior
| # | ||
|
|
||
| requests_mock.exceptions.Timeout = requests.exceptions.Timeout | ||
| requests_mock.exceptions.ConnectionError = requests.exceptions.ConnectionError |
There was a problem hiding this comment.
Is this needed here if the this test is only for Timeout exception?
There was a problem hiding this comment.
Yeah lbecause of how Python exception mocking works
| No metrics should be sent if "Enabled via Config file but Disabled via Envvar" | ||
| """ | ||
| # Enable it via configuration file | ||
| self.set_config(telemetry_enabled=True) |
There was a problem hiding this comment.
Personally, I am not crazy about setting this config through code, as these are integ tests and should be set how customers would enable/disable. I am ok with it, just would prefer always going through customer paths in our integ tests.
There was a problem hiding this comment.
This is how customers would enable telemetry. Thru the config.
There was a problem hiding this comment.
There is a sight nuance to me though. This function gets called through command executions for the customers. The customer would never explicitly call this method. I know it’s what happens for them but since a customer never directly interacts with it, calling the method in an integ test looks off to me. Not blocking on this, just something I noticed
There was a problem hiding this comment.
Sure, but we need some way of mimicing customer's environment. Calling this method is a way to do that
|
Couple of StartApi tests failed in Travis 2.7 only. This should be transient because I have never seen them fail before. Merging the PR anyway |
Issue #, if available:
Description of changes:
Checklist:
make prpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.