mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
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.
30 lines
688 B
Python
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}
|