fix: back off after ops claim errors
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a02b6f-7db1-7222-918b-e813a6bda38d
This commit is contained in:
parent
81d6222c6b
commit
db588010f7
3 changed files with 37 additions and 4 deletions
|
|
@ -7,7 +7,12 @@ from unittest.mock import MagicMock, patch
|
|||
from rein_aharness.approaches import ApproachResult, APPROACH_FI_RESEARCH_BRIEF
|
||||
from rein_aharness.claim_loop import process_one, poll_peek
|
||||
from rein_aharness.glas_execution import GLAS_APPROACH, GlasExecutionError
|
||||
from rein_aharness.ops_run_client import OpsRun, OpsRunConfig, ActivityCoreOpsClient
|
||||
from rein_aharness.ops_run_client import (
|
||||
ActivityCoreOpsClient,
|
||||
OpsRun,
|
||||
OpsRunConfig,
|
||||
OpsRunError,
|
||||
)
|
||||
|
||||
|
||||
def _claimed_run() -> OpsRun:
|
||||
|
|
@ -34,6 +39,16 @@ def test_process_one_empty() -> None:
|
|||
assert r.claimed is False
|
||||
|
||||
|
||||
def test_process_one_claim_error_requests_full_backoff() -> None:
|
||||
client = MagicMock(spec=ActivityCoreOpsClient)
|
||||
client.config = OpsRunConfig(worker_id="w", lease_seconds=90)
|
||||
client.claim.side_effect = OpsRunError("upstream failed")
|
||||
result = process_one(client)
|
||||
assert result.claimed is False
|
||||
assert result.empty is False
|
||||
assert result.retry_full_interval is True
|
||||
|
||||
|
||||
def test_process_one_success_completes() -> None:
|
||||
client = MagicMock(spec=ActivityCoreOpsClient)
|
||||
client.config = OpsRunConfig(worker_id="w", lease_seconds=90)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue