This is an automated email from the ASF dual-hosted git repository. jialiang pushed a commit to branch AMBARI-26105 in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 712114d2018106da3eda79a2371f3c79192c0c6d Author: jialiang <[email protected]> AuthorDate: Wed Jul 31 11:17:35 2024 +0800 AMBARI-26105: Fix TestPortAlert.py unit test failures in Ambari agent due to Python 2 to 3 upgrade --- ambari-agent/src/test/python/ambari_agent/TestPortAlert.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py b/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py index 0a47f3b8a5..845a8cf277 100644 --- a/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py +++ b/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py @@ -393,7 +393,7 @@ class TestPortAlert(TestCase): alert.set_cluster(cluster, cluster_id, host) alert.configuration_builder = MagicMock() s = socket() - s.recv.return_value = "imok" + s.recv.return_value = "imok".encode() def collector_side_effect(clus, data): self.assertEqual(data['name'], alert_meta['name']) @@ -451,7 +451,7 @@ class TestPortAlert(TestCase): alert.set_cluster(cluster, cluster_id, host) alert.configuration_builder = MagicMock() s = socket() - s.recv.return_value = "imok" + s.recv.return_value = "imok".encode() def collector_side_effect(clus, data): self.assertEqual(data['name'], alert_meta['name']) @@ -510,7 +510,7 @@ class TestPortAlert(TestCase): alert.configuration_builder = MagicMock() s = socket() - s.recv.return_value = "imok" + s.recv.return_value = "imok".encode() def collector_side_effect(clus, data): self.assertEqual(data['name'], alert_meta['name']) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
