From 1e6aca0bff900b561e55f74deb44a41db7740bbf Mon Sep 17 00:00:00 2001 From: Adrian Chaves Date: Wed, 29 Apr 2026 22:22:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_crawler_subprocess.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_crawler_subprocess.py b/tests/test_crawler_subprocess.py index b12132a82..a5f1917e2 100644 --- a/tests/test_crawler_subprocess.py +++ b/tests/test_crawler_subprocess.py @@ -11,6 +11,7 @@ from typing import TYPE_CHECKING import pytest from packaging.version import parse as parse_version +from pexpect.exceptions import EOF from pexpect.popen_spawn import PopenSpawn from w3lib import __version__ as w3lib_version @@ -232,7 +233,9 @@ class TestCrawlerProcessSubprocessBase(ScriptRunnerMixin): p.kill(sig) p.expect_exact("dropping downloader requests") p.kill(sig) - p.expect_exact("forcing unclean shutdown") + # Depending on timing, fast shutdown may complete before the third + # signal handler logs the force-shutdown message. + p.expect_exact(["forcing unclean shutdown", EOF]) p.wait() # type: ignore[no-untyped-call] @coroutine_test