This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 7c2885d21e Make livy connection failure test less picky (#35852)
7c2885d21e is described below
commit 7c2885d21ef3ee7684b391cb2e7a553ca6821c3d
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Nov 25 14:18:56 2023 +0100
Make livy connection failure test less picky (#35852)
The new dependencies released changed slightly the response returned
when connection failure occured ("Temporary Failure in Name Resolution"
instead of "Name or service not known").
This PR makes the test less picky w/regards to what exactly error
message to expect.
---
tests/providers/apache/livy/triggers/test_livy.py | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/tests/providers/apache/livy/triggers/test_livy.py
b/tests/providers/apache/livy/triggers/test_livy.py
index 2cf1fbfc99..ac1464ffd4 100644
--- a/tests/providers/apache/livy/triggers/test_livy.py
+++ b/tests/providers/apache/livy/triggers/test_livy.py
@@ -107,18 +107,11 @@ class TestLivyTrigger:
task = [i async for i in trigger.run()]
assert len(task) == 1
- assert (
- TriggerEvent(
- {
- "status": "error",
- "batch_id": 1,
- "response": "Batch 1 did not succeed with Cannot connect
to host livy:8998 ssl:default "
- "[Name or service not known]",
- "log_lines": None,
- }
- )
- in task
- )
+ event = task[0]
+ assert isinstance(event, TriggerEvent)
+ assert event.payload.get("status") == "error"
+ assert event.payload.get("batch_id") == 1
+ assert "Cannot connect to host livy:8998 ssl:default" in
event.payload.get("response")
@pytest.mark.db_test
@pytest.mark.asyncio