Close PopenSpawn stdin and stdout explicitly.

This commit is contained in:
Andrey Rakhmatullin 2026-06-20 02:54:56 +05:00
parent 55b457f11d
commit a54a8923ea
2 changed files with 6 additions and 0 deletions

View File

@ -159,5 +159,7 @@ class TestInteractiveShell:
p.expect_exact("HtmlResponse")
p.sendeof()
p.wait() # type: ignore[no-untyped-call]
p.proc.stdin.close()
p.proc.stdout.close()
logfile.seek(0)
assert "Traceback" not in logfile.read().decode()

View File

@ -215,6 +215,8 @@ class TestCrawlerProcessSubprocessBase(ScriptRunnerMixin):
p.expect_exact("shutting down gracefully")
p.expect_exact("Spider closed (shutdown)")
p.wait() # type: ignore[no-untyped-call]
p.proc.stdin.close()
p.proc.stdout.close()
def test_shutdown_graceful(self) -> None:
self._test_shutdown_graceful()
@ -232,6 +234,8 @@ class TestCrawlerProcessSubprocessBase(ScriptRunnerMixin):
p.kill(sig)
p.expect_exact("forcing unclean shutdown")
p.wait() # type: ignore[no-untyped-call]
p.proc.stdin.close()
p.proc.stdout.close()
@coroutine_test
async def test_shutdown_forced(self) -> None: