Doroszlai, Attila created AMBARI-23197:
------------------------------------------
Summary: Ambari Agent unit test failures on Python 2.7
Key: AMBARI-23197
URL: https://issues.apache.org/jira/browse/AMBARI-23197
Project: Ambari
Issue Type: Bug
Components: ambari-agent
Affects Versions: 2.7.0
Reporter: Doroszlai, Attila
Fix For: 2.7.0
The following 2 tests consistently fail on CentOS7 with Python 2.7.5:
{noformat:title=mvn -am -pl ambari-agent -Drat.skip clean test}
======================================================================
FAIL: test_load_definitions_noFile
(TestAlertSchedulerHandler.TestAlertSchedulerHandler)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"ambari-agent/src/test/python/ambari_agent/TestAlertSchedulerHandler.py", line
314, in test_load_definitions_noFile
self.assertEquals(definitions, [])
AssertionError: Lists differ: [<ambari_agent.alerts.port_ale... != []
First list contains 1 additional elements.
First extra element 0:
<ambari_agent.alerts.port_alert.PortAlert object at 0x384c990>
- [<ambari_agent.alerts.port_alert.PortAlert object at 0x384c990>]
+ []
======================================================================
FAIL: test_generation (TestCertGeneration.TestCertGeneration)
----------------------------------------------------------------------
Traceback (most recent call last):
File "ambari-common/src/test/python/mock/mock.py", line 1199, in patched
return func(*args, **keywargs)
File "ambari-agent/src/test/python/ambari_agent/TestCertGeneration.py", line
49, in test_generation
self.assertTrue(os.path.exists(self.certMan.getAgentKeyName()))
AssertionError: False is not true
----------------------------------------------------------------------
Ran 342 tests in 17.726s
FAILED (failures=2)
{noformat}
The first one also fails on Ubuntu 16 with Python 2.7.12:
{noformat}
FAIL: test_load_definitions_noFile
(TestAlertSchedulerHandler.TestAlertSchedulerHandler)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"ambari-agent/src/test/python/ambari_agent/TestAlertSchedulerHandler.py", line
314, in test_load_definitions_noFile
self.assertEquals(definitions, [])
AssertionError: Lists differ: [<ambari_agent.alerts.port_ale... != []
First list contains 1 additional elements.
First extra element 0:
<ambari_agent.alerts.port_alert.PortAlert object at 0x7fbc86c56fd0>
- [<ambari_agent.alerts.port_alert.PortAlert object at 0x7fbc86c56fd0>]
+ []
----------------------------------------------------------------------
Ran 342 tests in 18.052s
FAILED (failures=1)
{noformat}
Also seen in Jenkins:
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1083/
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/950/
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/938/
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)