Comment 1 for bug 1757928

Revision history for this message
Jianghua Wang (wjh-fresh) wrote :

It's easy to reproduce this problem with master branch also.
With some debug. I think it's due to the mock on urlopen doesn't take effective sometime (not sure why it does work sometime).

Successful#####
time: 2018-03-22 03:10:23.251676Z
tags: worker-3
test: os_xenapi.tests.plugins.test_glance.GlanceTestCase.test_download_ok_extract_failed
time: 2018-03-22 03:10:23.260027Z
successful: os_xenapi.tests.plugins.test_glance.GlanceTestCase.test_download_ok_extract_failed [ multipart
Content-Type: text/plain;charset=utf8
stdout
90^M
wjh: calling utils.extract_tarball
wjh: finally
error is 'fake_cmd' returned non-zero exit code: retcode=0, out='fake_out', stderr='fake_stderr'0^M
]

## failed####
test: os_xenapi.tests.plugins.test_glance.GlanceTestCase.test_download_ok_extract_failed
time: 2018-03-22 03:07:50.162910Z
failure: os_xenapi.tests.plugins.test_glance.GlanceTestCase.test_download_ok_extract_failed [ multipart
Content-Type: text/plain;charset=utf8
stdout
1D^M
error is <urlopen error None>0^M
Content-Type: text/x-traceback;language=python,charset=utf8
traceback
215^M
Traceback (most recent call last):
  File "/root/os-xenapi/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "os_xenapi/tests/plugins/test_glance.py", line 126, in test_download_ok_extract_failed
    mock_extract_tarball.assert_called_once()
  File "/root/os-xenapi/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 915, in assert_called_once
    raise AssertionError(msg)
AssertionError: Expected 'extract_tarball' to have been called once. Called 0 times.
0^M
]