You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Andrew Onischuk (JIRA)" <ji...@apache.org> on 2015/03/07 16:42:38 UTC

[jira] [Resolved] (AMBARI-9975) Local unit tests failing in TestCheckHost.py

     [ https://issues.apache.org/jira/browse/AMBARI-9975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Onischuk resolved AMBARI-9975.
-------------------------------------
    Resolution: Fixed

Committed to trunk and branch-2.0.0

> Local unit tests failing in TestCheckHost.py
> --------------------------------------------
>
>                 Key: AMBARI-9975
>                 URL: https://issues.apache.org/jira/browse/AMBARI-9975
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Andrew Onischuk
>            Assignee: Andrew Onischuk
>             Fix For: 2.0.0
>
>
> Local maven unit tests are failing on trunk, yet BAO is fine,
> <https://builds.apache.org/job/Ambari-trunk-Commit/1880/>
> My environment is,  
> java version "1.7.0_60"  
> Java(TM) SE Runtime Environment (build 1.7.0_60-b19)  
> Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
> I'm on commit 2068caa7ebc029752b0db1eaef1372177e7003ba which corresponds to
> AMBARI-9820
>     
>     
>     
>     Failed tests:
>     ERROR: testDBConnectionCheck (TestCheckHost.TestCheckHost)
>     ----------------------------------------------------------------------
>     Traceback (most recent call last):
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-common/src/test/python/mock/mock.py", line 1199, in patched
>         return func(*args, **keywargs)
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/test/python/custom_actions/TestCheckHost.py", line 95, in testDBConnectionCheck
>         checkHost = CheckHost()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/main/resources/custom_actions/scripts/check_host.py", line 89, in __init__
>         self.reportFileHandler = HostCheckReportFileHandler()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 39, in __init__
>         config = self.resolve_ambari_config()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 55, in resolve_ambari_config
>         return config
>     UnboundLocalError: local variable 'config' referenced before assignment
>     
>     ERROR: testHostResolution (TestCheckHost.TestCheckHost)
>     ----------------------------------------------------------------------
>     Traceback (most recent call last):
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-common/src/test/python/mock/mock.py", line 1199, in patched
>         return func(*args, **keywargs)
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/test/python/custom_actions/TestCheckHost.py", line 197, in testHostResolution
>         checkHost = CheckHost()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/main/resources/custom_actions/scripts/check_host.py", line 89, in __init__
>         self.reportFileHandler = HostCheckReportFileHandler()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 39, in __init__
>         config = self.resolve_ambari_config()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 55, in resolve_ambari_config
>         return config
>     UnboundLocalError: local variable 'config' referenced before assignment
>     
>     ERROR: testInvalidCheck (TestCheckHost.TestCheckHost)
>     ----------------------------------------------------------------------
>     Traceback (most recent call last):
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-common/src/test/python/mock/mock.py", line 1199, in patched
>         return func(*args, **keywargs)
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/test/python/custom_actions/TestCheckHost.py", line 235, in testInvalidCheck
>         checkHost = CheckHost()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/main/resources/custom_actions/scripts/check_host.py", line 89, in __init__
>         self.reportFileHandler = HostCheckReportFileHandler()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 39, in __init__
>         config = self.resolve_ambari_config()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 55, in resolve_ambari_config
>         return config
>     UnboundLocalError: local variable 'config' referenced before assignment
>     
>     ERROR: testJavaHomeAvailableCheck (TestCheckHost.TestCheckHost)
>     ----------------------------------------------------------------------
>     Traceback (most recent call last):
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-common/src/test/python/mock/mock.py", line 1199, in patched
>         return func(*args, **keywargs)
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/test/python/custom_actions/TestCheckHost.py", line 55, in testJavaHomeAvailableCheck
>         checkHost = CheckHost()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-server/src/main/resources/custom_actions/scripts/check_host.py", line 89, in __init__
>         self.reportFileHandler = HostCheckReportFileHandler()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 39, in __init__
>         config = self.resolve_ambari_config()
>       File "/Users/afernandez/Documents/git/ambari-vagrant/centos6.4/ambari/ambari-agent/src/main/python/ambari_agent/HostCheckReportFileHandler.py", line 55, in resolve_ambari_config
>         return config
>     UnboundLocalError: local variable 'config' referenced before assignment
>     
> Seems to be related to AMBARI-9795
>     
>     
>     
>       def resolve_ambari_config(self):
>         try:
>           config = AmbariConfig()
>           if os.path.exists(AmbariConfig.getConfigFile()):
>             config.read(AmbariConfig.getConfigFile())
>           else:
>             raise Exception("No config found, use default")
>     
>         except Exception, err:
>           logger.warn(err)
>         return config
>     



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)