There is no async code here, so this timeout does not really work as expected: https://github.com/10gen/mongo/blob/74aebe28de1ed67df5b3e6ff3269f0b6d59ef8e1/buildscripts/metrics/tooling_metrics_utils.py#L73
Thanks max.hirschhorn@mongodb.com for identifying a better way to do this:
We should just explicitly set timeouts in pymongo code (setting the connection timeout, the socket timeout, and maxTimeMS). Slack thread: https://mongodb.slack.com/archives/CQDQ9R413/p1668615726847349?thread_ts=1667588594.452019&cid=CQDQ9R413
(You may also want to disable retryable writes which are enabled by default in drivers because you don't want to spend extra time retrying if you get a broken network connection)