Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Lib/test/audit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down