diff --git a/certbot-ci/certbot_integration_tests/apache_tests/context.py b/certbot-ci/certbot_integration_tests/apache_tests/context.py index 6001632d1..0576650aa 100644 --- a/certbot-ci/certbot_integration_tests/apache_tests/context.py +++ b/certbot-ci/certbot_integration_tests/apache_tests/context.py @@ -1,3 +1,4 @@ +import errno import os import signal import subprocess @@ -42,4 +43,9 @@ class IntegrationTestsContext(certbot_context.IntegrationTestsContext): pid = None if pid: - os.kill(pid, signal.SIGTERM) + try: + os.kill(pid, signal.SIGTERM) + except OSError as err: + # Ignore "No such process" error, Apache may already be stopped. + if err.errno != errno.ESRCH: + raise