YAshhh29 commented on code in PR #75916:
URL: https://github.com/apache/airflow/pull/75916#discussion_r4540850844
##########
providers/common/ai/tests/unit/common/ai/durable/test_storage.py:
##########
@@ -126,6 +127,96 @@ def
test_deleting_when_there_is_no_file_does_not_raise(self, storage):
storage.delete_steps(["a"])
+def store_down():
+ return patch.object(DurableStorage, "_write", autospec=True,
side_effect=OSError("store unavailable"))
+
+
+class TestStoreFailures:
+ def test_a_failed_write_skips_the_step_without_raising(self, storage):
+ with store_down(), patch.object(storage_module, "log") as mock_log:
Review Comment:
The `read_text` test went with the read side. For `log`, `autospec=True`
gives a mock with no `.warning`: `get_task_logger()` returns structlog's
`BoundLoggerLazyProxy`, which resolves it through `__getattr__`. I used
`spec=FilteringBoundLogger` as #76381 does, and the test now asserts the exact
message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]