fix: finish test_isolated cleanup on Ctrl+C
uv run forwards SIGINT to the child that already got it from the process group, so the second KeyboardInterrupt aborted the cleanup and left the test container and database behind. Run the script with $(PYTHON) like the skeleton checks and ignore SIGINT during cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,11 +7,18 @@
|
||||
в том числе по Ctrl+C. Рабочая база и рабочий контейнер API не
|
||||
трогаются. Только stdlib: всё через docker compose и make. Решение 12
|
||||
design change `postgres-storage`.
|
||||
|
||||
Запускается напрямую `$(PYTHON)`, как проверки skeleton, а не через
|
||||
`uv run`: uv пересылает SIGINT дочернему процессу, хотя тот уже получил
|
||||
его от группы процессов, и второй `KeyboardInterrupt` обрывал уборку.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@@ -194,6 +201,8 @@ def main() -> int:
|
||||
say(f"setup failed: {e}")
|
||||
results["setup"] = 1
|
||||
finally:
|
||||
# повторный Ctrl+C не должен оборвать уборку на полпути
|
||||
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||
if failed:
|
||||
say(f"last {LOG_TAIL_LINES} lines of {container}")
|
||||
run(
|
||||
|
||||
Reference in New Issue
Block a user