File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ if ! command -v just &>/dev/null; then
5252 echo " Installing just..."
5353 mkdir -p " $_BIN_DIR " 2> /dev/null || true
5454 curl --proto ' =https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to " $_BIN_DIR " || {
55+ # Remove just file if it exists (can be created if there was an install error).
56+ rm -f ${_BIN_DIR} /just
5557 _pip_install rust-just just
5658 }
5759 echo " Installing just... done."
Original file line number Diff line number Diff line change @@ -225,6 +225,20 @@ def response_callback(*args):
225225
226226 await self .run_scenario (response_callback , False )
227227
228+ @flaky (reason = "PYTHON-5500" )
229+ async def test_dns_failures_logging (self ):
230+ from dns import exception
231+
232+ with self .assertLogs ("pymongo.topology" , level = "DEBUG" ) as cm :
233+
234+ def response_callback (* args ):
235+ raise exception .Timeout ("DNS Failure!" )
236+
237+ await self .run_scenario (response_callback , False )
238+
239+ srv_failure_logs = [r for r in cm .records if "SRV monitor check failed" in r .getMessage ()]
240+ self .assertEqual (len (srv_failure_logs ), 1 )
241+
228242 async def test_dns_record_lookup_empty (self ):
229243 response : list = []
230244 await self .run_scenario (response , False )
Original file line number Diff line number Diff line change @@ -225,6 +225,20 @@ def response_callback(*args):
225225
226226 self .run_scenario (response_callback , False )
227227
228+ @flaky (reason = "PYTHON-5500" )
229+ def test_dns_failures_logging (self ):
230+ from dns import exception
231+
232+ with self .assertLogs ("pymongo.topology" , level = "DEBUG" ) as cm :
233+
234+ def response_callback (* args ):
235+ raise exception .Timeout ("DNS Failure!" )
236+
237+ self .run_scenario (response_callback , False )
238+
239+ srv_failure_logs = [r for r in cm .records if "SRV monitor check failed" in r .getMessage ()]
240+ self .assertEqual (len (srv_failure_logs ), 1 )
241+
228242 def test_dns_record_lookup_empty (self ):
229243 response : list = []
230244 self .run_scenario (response , False )
You can’t perform that action at this time.
0 commit comments