feat: recover failed scheduled uploads with bounded persistent retries [skip ci]
This commit is contained in:
+12
-10
@@ -71,22 +71,24 @@ def test_nested_overrides(service):
|
||||
assert service.registry.get("living-room").get_current_image() == 1
|
||||
|
||||
|
||||
def test_no_retry_unknown(service):
|
||||
def test_unknown_does_not_block_new_independent_upload(service):
|
||||
driver = service.registry.get("living-room")
|
||||
attempts = []
|
||||
|
||||
def timeout(*a):
|
||||
def timeout(*args):
|
||||
attempts.append(args)
|
||||
raise FlowError(ErrorCode.WRITE_RESULT_UNKNOWN, "Write outcome unknown", 502)
|
||||
|
||||
driver.upload = timeout
|
||||
id = submit(service)
|
||||
first = submit(service)
|
||||
service.process_one()
|
||||
assert service.operation(id)["status"] == "UNKNOWN"
|
||||
with pytest.raises(FlowError):
|
||||
submit(service)
|
||||
assert service.process_one() is False
|
||||
assert service.reconcile(id)["resolved"] is False
|
||||
assert service.reconcile(id, True)["resolved"] is True
|
||||
assert service.operation(id)["status"] == "FAILED"
|
||||
assert service.operation(first)["status"] == "UNKNOWN"
|
||||
second = submit(service, priority=10)
|
||||
assert second != first
|
||||
assert service.process_one()
|
||||
assert service.operation(first)["status"] == "FAILED"
|
||||
assert service.operation(second)["status"] == "UNKNOWN"
|
||||
assert len(attempts) == 2
|
||||
|
||||
|
||||
def test_restart_preserves_override(service):
|
||||
|
||||
Reference in New Issue
Block a user