Benoit Chesneau 5e3c07d11d test(dirty): add Docker-based parent death integration tests
Add comprehensive Docker integration tests verifying dirty arbiter
lifecycle under realistic conditions:
- Parent death detection via ppid monitoring
- Orphan cleanup on restart
- Dirty arbiter respawning after crash
- Graceful shutdown with SIGTERM

Also fix race condition in manage_workers() by checking self.alive
before spawning new workers during shutdown.
2026-01-25 10:23:25 +01:00

30 lines
688 B
Python

#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
"""
Simple WSGI and Dirty applications for integration testing.
"""
from gunicorn.dirty.app import DirtyApp
def application(environ, start_response):
"""Simple WSGI application."""
start_response('200 OK', [('Content-Type', 'text/plain')])
return [b'OK']
class TestDirtyApp(DirtyApp):
"""Minimal dirty app for testing process lifecycle."""
def init(self):
self.call_count = 0
def ping(self):
self.call_count += 1
return {"pong": True, "calls": self.call_count}
def echo(self, message):
return {"message": message}