https://github.com/python/cpython/commit/442a299af06d0dfe89484a841451666503479e2e
commit: 442a299af06d0dfe89484a841451666503479e2e
branch: main
author: Steve Dower <[email protected]>
committer: zooba <[email protected]>
date: 2024-01-26T14:38:24Z
summary:

gh-114272: Allow _wmi audit test to succeed even if it times out (GH-114602)

files:
M Lib/test/audit-tests.py

diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py
index ce4a11b119c900..de7d0da560a1c7 100644
--- a/Lib/test/audit-tests.py
+++ b/Lib/test/audit-tests.py
@@ -487,7 +487,13 @@ def hook(event, args):
             print(event, args[0])
 
     sys.addaudithook(hook)
-    _wmi.exec_query("SELECT * FROM Win32_OperatingSystem")
+    try:
+        _wmi.exec_query("SELECT * FROM Win32_OperatingSystem")
+    except WindowsError as e:
+        # gh-112278: WMI may be slow response when first called, but we still
+        # get the audit event, so just ignore the timeout
+        if e.winerror != 258:
+            raise
 
 def test_syslog():
     import syslog

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to