Skip to content

Avoid indefinite hang in test.test_logging.HTTPHandlerTest.test_output if request fails #117552

@colesbury

Description

@colesbury

This unit test logs to an HTTP backend. If for some reason the request fails, then the self.handled.wait() will bock indefinitely. In practice that means until the test runner times out, which can be after over an hour.

We should add a timeout in self.handled.wait() and fail the test more quickly if the timeout expires.

for method in ('GET', 'POST'):
self.h_hdlr.method = method
self.handled.clear()
msg = "sp\xe4m"
logger.error(msg)
self.handled.wait()

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions