fix: wait for bounded receive scanning during sync pushes
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a1346b-72a4-7d40-b8bd-8b8ca346cfa2
This commit is contained in:
parent
5830ba3c15
commit
7183f5993a
3 changed files with 85 additions and 1 deletions
37
tests/test_push_deadline.py
Normal file
37
tests/test_push_deadline.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""Client deadlines must accommodate receive scanning without claiming timeout refusal."""
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
|
||||
import repo_sync as module
|
||||
|
||||
|
||||
def test_push_budget_covers_admitted_scanner(monkeypatch, tmp_path):
|
||||
observed = {}
|
||||
|
||||
def run(argv, **kwargs):
|
||||
observed.update(argv=argv, **kwargs)
|
||||
return subprocess.CompletedProcess(argv, 0, "", "")
|
||||
|
||||
monkeypatch.setattr(module.subprocess, "run", run)
|
||||
ok, _ = module.push_ff(tmp_path)
|
||||
assert ok
|
||||
assert 90 < observed["timeout"] <= 180
|
||||
assert "--force" not in observed["argv"]
|
||||
|
||||
|
||||
def test_timeout_is_unverified_without_retry_or_child_output(monkeypatch, tmp_path):
|
||||
calls = []
|
||||
|
||||
def run(argv, **kwargs):
|
||||
calls.append(argv)
|
||||
raise subprocess.TimeoutExpired(argv, kwargs["timeout"], output="private diagnostic fixture")
|
||||
|
||||
monkeypatch.setattr(module.subprocess, "run", run)
|
||||
ok, message = module.push_ff(tmp_path)
|
||||
assert not ok
|
||||
assert "remote outcome unverified" in message
|
||||
assert "inspect the remote ref" in message
|
||||
assert "private diagnostic fixture" not in message
|
||||
assert len(calls) == 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue