unit tests failed with RequiredOptError

Bug #1582465 reported by Wenjun Wang
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Won't Fix
Undecided
Unassigned

Bug Description

the latest commit:9ec54a3f27c683ac3bc5807b81971e1f5a2be99a
Date: Fri May 13 18:43:49 2016 +0000
on glance master whit ubuntu 14,
I used proxy server to internet,

tox -e py27 --

I got so many failed unit tests like this:

glance.tests.unit.v2.test_tasks_resource.TestTasksDeserializer.test_index_negative_limit
----------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "glance/tests/unit/v2/test_tasks_resource.py", line 475, in setUp
        super(TestTasksDeserializer, self).setUp()
      File "glance/tests/utils.py", line 73, in setUp
        config.parse_args(args=[])
      File "glance/common/config.py", line 186, in parse_args
        default_config_files=default_config_files)
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 2169, in __call__
        self._check_required_opts()
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 2736, in _check_required_opts
        raise RequiredOptError(opt.name, group)
    oslo_config.cfg.RequiredOptError: value required for option: keystone_authtoken.auth-url

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

other failed tests traceback:

glance.tests.functional.test_cache_middleware.TestImageCacheXattr.test_cache_middleware_transparent_v2
------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "glance/tests/utils.py", line 177, in wrapped
        func(*a, **kwargs)
      File "glance/tests/functional/test_cache_middleware.py", line 138, in test_cache_middleware_transparent_v2
        body=jsonutils.dumps(image_entity))
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1609, in request
        (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1351, in _request
        (response, content) = self._conn_request(conn, request_uri, method, body, headers)
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
        conn.connect()
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/__init__.py", line 916, in connect
        self.sock.connect((self.host, self.port) + sa[2:])
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/socks.py", line 424, in connect
        self.__negotiatehttp(destpair[0], destpair[1])
      File "/home/tecs/glance/.tox/py27/local/lib/python2.7/site-packages/httplib2/socks.py", line 390, in __negotiatehttp
        raise HTTPError((statuscode, statusline[2]))
    httplib2.socks.HTTPError: (504, 'Gateway Time-out')

is this a bug of unit test?

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

It looks like that the tests "glance.unit.api.test_cmd.TestGlanceApiCmd.test_unsupported_default_store broke" the test. You can comment out this test and try again.

Changed in glance:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
Wenjun Wang (wangwenjun) wrote :

Yes,this can solve the problme.but some other failed tests exist,I will tip on the Bug Description.

description: updated
Revision history for this message
liwei (wei-li) wrote :

I also encountered the same problem in glance.Is there any way to solve it?

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

Sorry that i'm too busy to analyse it. Feel free to assign this bug to yourself.

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

Hi,

If you add below line in in test_unsupported_default_store after self.stubs.UnsetAll() then it will resolve this issue.

self.stubs.Set(glance.common.config, 'load_paste_app', self._do_nothing)

The cause of failure is self.stubs.UnsetAll() will unset all the configuration stubbed in setUp() method, however we still need to stub load_paste_app to avoid actual loading of the same.

wangxiyuan (wangxiyuan)
Changed in glance:
assignee: wangxiyuan (wangxiyuan) → nobody
Revision history for this message
zhuangzejian (zhuangzejian) wrote :

Kekane's method is absolutely useful.
Thanks you Kekane.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

The tests work fine in the CI, and py27 is no longer supported. Closing this, feel free to reopen if you still hit this bug.

Changed in glance:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.