summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2024-01-26 14:38:24 (GMT)
committerGitHub <noreply@github.com>2024-01-26 14:38:24 (GMT)
commit442a299af06d0dfe89484a841451666503479e2e (patch)
treef878c8cc3cefc6a147940c567ec4456b1cbc9c97
parent30b7b4f73cd876732244de06d079a2caf2a7b95c (diff)
downloadcpython-442a299af06d0dfe89484a841451666503479e2e.zip
cpython-442a299af06d0dfe89484a841451666503479e2e.tar.gz
cpython-442a299af06d0dfe89484a841451666503479e2e.tar.bz2
gh-114272: Allow _wmi audit test to succeed even if it times out (GH-114602)
-rw-r--r--Lib/test/audit-tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py
index ce4a11b..de7d0da 100644
--- a/Lib/test/audit-tests.py
+++ b/Lib/test/audit-tests.py
@@ -487,7 +487,13 @@ def test_wmi_exec_query():
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