Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ dev = [
"httpx>=0.27",
"fastapi>=0.110",
"uvicorn>=0.29",
"mcp>=1.2",
"mcp>=1.2,<2",
]
api = [
"fastapi>=0.110",
"uvicorn>=0.29",
]
mcp = [
"mcp>=1.2",
"mcp>=1.2,<2",
]
render = [
"manim>=0.19",
Expand Down
7 changes: 7 additions & 0 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class ResponseBody:
def read(self):
return b'{"error":"bad auth"}'

def close(self):
# HTTPError wraps fp in a finalizer that calls close() on GC. Without
# this, the AttributeError surfaces as an unraisable exception inside
# whatever unrelated test happens to be running when the collector
# gets to it.
pass

def raise_httperror(*args, **kwargs):
raise HTTPError(
url="https://example.test/v1/chat/completions",
Expand Down
19 changes: 16 additions & 3 deletions tests/test_sol_staged_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import subprocess
import sys
import threading
import time
from pathlib import Path

import pytest
Expand Down Expand Up @@ -66,9 +67,21 @@ def __init__(self):
self.returncode = 0

def wait(self, timeout=None):
observed["trace_during_wait"] = (
tmp_path / "trace.jsonl"
).read_text(encoding="utf-8")
# CodexCli streams stdout to the trace from a daemon thread it only
# joins after wait() returns, so nothing orders that thread against
# this call. Poll instead of reading once: the point of the
# assertion is that the trace fills during the run rather than
# afterwards, and a bare read just races the reader thread.
trace = tmp_path / "trace.jsonl"
deadline = time.monotonic() + 10.0
text = ""
while time.monotonic() < deadline:
if trace.is_file():
text = trace.read_text(encoding="utf-8")
if "thread.started" in text:
break
time.sleep(0.01)
observed["trace_during_wait"] = text
return self.returncode

def kill(self):
Expand Down