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
52
52
echo " Installing just..."
53
53
mkdir -p " $_BIN_DIR " 2> /dev/null || true
54
54
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
55
57
_pip_install rust-just just
56
58
}
57
59
echo " Installing just... done."
Original file line number Diff line number Diff line change @@ -225,6 +225,20 @@ def response_callback(*args):
225
225
226
226
await self .run_scenario (response_callback , False )
227
227
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
+
228
242
async def test_dns_record_lookup_empty (self ):
229
243
response : list = []
230
244
await self .run_scenario (response , False )
Original file line number Diff line number Diff line change @@ -225,6 +225,20 @@ def response_callback(*args):
225
225
226
226
self .run_scenario (response_callback , False )
227
227
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
+
228
242
def test_dns_record_lookup_empty (self ):
229
243
response : list = []
230
244
self .run_scenario (response , False )
You can’t perform that action at this time.
0 commit comments