You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/12/25 08:56:02 UTC
[airflow] branch main updated: Fix flaky test_push_ssh_exit_to_xcom test (#28584)
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 de4ea29993 Fix flaky test_push_ssh_exit_to_xcom test (#28584)
de4ea29993 is described below
commit de4ea29993fec7a676a4bf3595ac90fd81097f06
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Dec 25 09:55:55 2022 +0100
Fix flaky test_push_ssh_exit_to_xcom test (#28584)
The test had randrange(0,100) for exit code and that included
0 - which generated no exception at all.
Fix is to increase the range to start from 1
---
tests/providers/ssh/operators/test_ssh.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/providers/ssh/operators/test_ssh.py b/tests/providers/ssh/operators/test_ssh.py
index 9065df9a3d..43d6c64443 100644
--- a/tests/providers/ssh/operators/test_ssh.py
+++ b/tests/providers/ssh/operators/test_ssh.py
@@ -204,7 +204,7 @@ class TestSSHOperator:
def test_push_ssh_exit_to_xcom(self, request, dag_maker):
# Test pulls the value previously pushed to xcom and checks if it's the same
command = "not_a_real_command"
- ssh_exit_code = randrange(0, 100)
+ ssh_exit_code = randrange(1, 100)
self.exec_ssh_client_command.return_value = (ssh_exit_code, b"", b"ssh output")
with dag_maker(dag_id=f"dag_{request.node.name}"):