Skip to content

[Windows] test_wmi: test_wmi_query_error test is flaky #130727

Closed
@colesbury

Description

@colesbury

Bug report

Seen in https://github.com/python/cpython/actions/runs/13606431591/job/38038447105?pr=130724 on both the default and free threading builds:

======================================================================
FAIL: test_wmi_query_error (test.test_wmi.WmiTests.test_wmi_query_error)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 50, in test_wmi_query_error
    self.fail("Expected OSError")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected OSError
----------------------------------------------------------------------
======================================================================
FAIL: test_wmi_query_repeated_error (test.test_wmi.WmiTests.test_wmi_query_repeated_error)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 54, in test_wmi_query_repeated_error
    self.test_wmi_query_error()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 50, in test_wmi_query_error
    self.fail("Expected OSError")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected OSError
----------------------------------------------------------------------
======================================================================
ERROR: test_wmi_query_repeated (test.test_wmi.WmiTests.test_wmi_query_repeated)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 40, in test_wmi_query_repeated
    self.test_wmi_query_os_version()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 28, in test_wmi_query_os_version
    r = wmi_exec_query("SELECT Version FROM Win32_OperatingSystem").split("\0")
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\test\test_wmi.py", line 23, in wmi_exec_query
    return _wmi.exec_query(query)
           ~~~~~~~~~~~~~~~^^^^^^^
TimeoutError: [WinError 258] The wait operation timed out
----------------------------------------------------------------------
Ran 8 tests in 45.543s
FAILED (errors=1, skipped=1)

In these cases the tests succeeded when retried.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions