Skip to content

test.test_sys.TestRemoteExec fails with AssertionError #132143

Closed
@littlebutt

Description

@littlebutt

Bug report

Bug description:

The test case test_sys failed when I ran rt.bat test_sys. The unittest report is as follow

FAIL: test_remote_exec_raises_audit_event (test.test_sys.TestRemoteExec.test_remote_exec_raises_audit_event)
Test remote exec raises an audit event
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\project\cpython\Lib\test\test_sys.py", line 2106, in test_remote_exec_raises_audit_event
    self.assertIn(b"Remote script executed successfully!", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'Remote script executed successfully!' not found in b'Target process running...\r\n'

----------------------------------------------------------------------
Ran 90 tests in 1.495s

FAILED (failures=1, skipped=7)
test test_sys failed

== Tests result: FAILURE ==

It seems that the problem is caused by an unfinished subprocess since it runs synchronizely. However, when I commented the first two assertion statements.

        # self.assertIn(b"Remote script executed successfully!", stdout)
        # self.assertIn(b"Audit event: remote_debugger_script, arg: ", stdout)
        self.assertEqual(stderr, b"")

The stderr is printed out as follow

Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\project\cpython\Lib\test\test_sys.py", line 2108, in test_remote_exec_raises_audit_event
    self.assertEqual(stderr, b"")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
AssertionError: b'Exception ignored in audit hook:\r\nTrace[295 chars]\r\n' != b''

OS: Windows 10 22H2

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesOS-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