Coverage for app/backend/src/healthcheck.py: 0%

5 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-05-31 14:08 +0000

1""" 

2Container healthcheck: connect to every API worker port. Exits non-zero if any worker isn't listening, so a 

3dead or crash-looping worker surfaces as an unhealthy container even though the supervising parent is still up. 

4""" 

5 

6import socket 

7 

8from couchers.constants import API_BASE_PORT, API_WORKER_COUNT 

9 

10for port in range(API_BASE_PORT, API_BASE_PORT + API_WORKER_COUNT): 

11 with socket.create_connection(("localhost", port), timeout=2): 

12 pass