Skip to content

Commit 876a72e

Browse files
committed
apply patch
1 parent aa0b920 commit 876a72e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.evergreen/scripts/install-dependencies.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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."

test/asynchronous/test_srv_polling.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

test/test_srv_polling.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)