Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-23197

Ambari Agent unit test failures on Python 2.7

    XMLWordPrintableJSON

Details

    Description

      The following 2 tests consistently fail on CentOS7 with Python 2.7.5:

      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)
      

      The first one also fails on Ubuntu 16 with Python 2.7.12:

      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)
      

      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/

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h