Make two new supervisor tests pass on Windows

The full-test leg on windows-latest failed for PR #1179 on two assertions
that are about the host, not about the behaviour under test:

- the stall journal path was compared with a forward-slash suffix, so
  `logs\supervisor.jsonl` never matched; compare path parts instead;
- the inherited deadline bound was compared with exactly 0.4, and a coarse
  monotonic clock returns the deadline itself, which prints as
  0.40000000000009095; allow a float epsilon.

No production code changes.
This commit is contained in:
Ouroboros 2026-09-21 12:00:04 +03:00
parent 825563217b
commit c57ee54c46
2 changed files with 3 additions and 2 deletions

View file

@ -181,7 +181,7 @@ def test_inherited_dispatch_deadline_narrows_the_tool_wait(repo, monkeypatch):
receipt = result.usage["native_tool_receipts"][0]
assert receipt["outcome"] == "error" and receipt["source_gap"] == "native_tool_abandoned"
bound = float(_tool_messages(llm)[0]["content"].split("exceeded ")[1].split("s limit")[0])
assert 0 < bound <= 0.4
assert 0 < bound <= 0.4 + 1e-6 # a coarse clock can return the deadline itself
release.set()
release_again, _holder_again = _install_registry(monkeypatch, hold_sec=3.0)

View file

@ -16,6 +16,7 @@ import logging
import re
import threading
import time
from pathlib import Path
import pytest
@ -107,7 +108,7 @@ def test_stall_row_carries_phase_cpu_and_event_lag(monkeypatch, journal):
_stop_watchdog(stop)
stalls = [row for _path, row in journal if row["type"] == "supervisor_loop_stall"]
assert len(stalls) == 1, journal
assert journal[0][0].endswith("logs/supervisor.jsonl")
assert Path(journal[0][0]).parts[-2:] == ("logs", "supervisor.jsonl")
row = stalls[0]
assert row["stalled_sec"] == pytest.approx(100.0, abs=1.0)
assert row["phase"] == "maintenance"