feat: introduce runner protocol and normalized event model (#7)
This commit is contained in:
@@ -2,16 +2,23 @@ import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from takopi import exec_bridge
|
||||
from takopi.runners import codex
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_manage_subprocess_kills_when_terminate_times_out() -> None:
|
||||
async with exec_bridge.manage_subprocess(
|
||||
async def test_manage_subprocess_kills_when_terminate_times_out(
|
||||
monkeypatch,
|
||||
) -> None:
|
||||
async def fake_wait_for_process(_proc, timeout: float) -> bool:
|
||||
_ = timeout
|
||||
return True
|
||||
|
||||
monkeypatch.setattr(codex, "_wait_for_process", fake_wait_for_process)
|
||||
|
||||
async with codex.manage_subprocess(
|
||||
sys.executable,
|
||||
"-c",
|
||||
"import signal, time; signal.signal(signal.SIGTERM, signal.SIG_IGN); time.sleep(10)",
|
||||
terminate_timeout=0.01,
|
||||
) as proc:
|
||||
assert proc.returncode is None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user