mongodb-labs / drivers-atlas-testing

Drivers Atlas Testing
Apache License 2.0
8 stars 27 forks source link

Catch and retry HTTP timeouts that happen while polling for cluster state. #160

Closed matthewdale closed 1 year ago

matthewdale commented 1 year ago

Sometimes the astrolabe CLI will exit when polling for Atlas cluster status due to an HTTP call timeout. An example exception output is:

atlasclient.exceptions.AtlasClientError: HTTPSConnectionPool(host='cloud-qa.mongodb.com', port=443): Read timed out. (read timeout=30.0) (GET https://cloud-qa.mongodb.com/api/atlas/v1.0/groups/639e9f7f25930c386c4e5ad3/clusters/4ba448af53)

Those HTTP call timeouts seem to be intermittent, so we should retry the call again instead of allowing the CLI to exit.

matthewdale commented 1 year ago

Verified this change works in the "happy path". My testing didn't encounter any HTTP timeout errors calling the cluster status API, so I haven't verified it actually fixes the problem. I'm going to merge it and see if it fixes the problem on the next scheduled run.