Assertion failed for get_image_url.call_count

Bug #1885523 reported by Yasufumi Ogawa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Critical
Yasufumi Ogawa

Bug Description

Unexpected assertion error is happend while running a unit test. It is also happed in zuul check recently. So we cannot pass the tests for merging patches without fixing this issue.

File "/opt/stack/tacker/tacker/tests/unit/vnfm/infra_drivers/openstack/test_openstack_driver.py", line 890, in test_pre_instantiation_vnf_image_with_file
    self.assertEqual(get_image_url.call_count, 2)

Here is a whole log of testing the unit test.

$ tox -e py36 tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file
py36 develop-inst-noop: /opt/stack/tacker
py36 installed: alembic==1.4.2,amqp==2.6.0,anyjson==0.3.3,appdirs==1.4.4,attrs==19.3.0,Babel==2.8.0,bcrypt==3.1.7,beautifulsoup4==4.9.1,cachetools==4.1.0,castellan==3.1.1,certifi==2020.6.20,cffi==1.14.0,chardet==3.0.4,cliff==3.3.0,cmd2==1.1.0,colorama==0.4.3,coverage==5.1,cryptography==2.9.2,ddt==1.4.1,debtcollector==2.1.0,decorator==4.4.2,dnspython==1.16.0,doc8==0.8.1,docutils==0.15.2,dogpile.cache==0.9.2,entrypoints==0.3,eventlet==0.25.2,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==3.7.9,future==0.18.2,futurist==2.2.0,glance-store==2.1.0,google-auth==1.18.0,greenlet==0.4.16,hacking==3.0.1,heat-translator==2.1.0,idna==2.9,importlib-metadata==1.6.1,importlib-resources==2.0.1,iso8601==0.1.12,Jinja2==2.11.2,jmespath==0.10.0,jsonpatch==1.25,jsonpointer==2.0,jsonschema==3.2.0,keystoneauth1==4.2.0,keystonemiddleware==9.0.0,kombu==4.6.11,kubernetes==11.0.0,linecache2==1.0.0,Mako==1.1.3,MarkupSafe==1.1.1,mccabe==0.6.1,mock==3.0.5,monotonic==1.5,msgpack==0.6.1,munch==2.5.0,netaddr==0.7.20,netifaces==0.10.9,oauthlib==3.1.0,openstacksdk==0.47.0,os-client-config==2.1.0,os-service-types==1.7.0,osc-lib==2.2.0,oslo.cache==2.4.1,oslo.concurrency==4.1.1,oslo.config==8.2.0,oslo.context==3.1.0,oslo.db==8.2.0,oslo.i18n==5.0.0,oslo.log==4.2.1,oslo.messaging==12.2.0,oslo.middleware==4.1.0,oslo.policy==3.2.1,oslo.reports==2.1.0,oslo.rootwrap==6.1.0,oslo.serialization==4.0.0,oslo.service==2.3.0,oslo.upgradecheck==1.1.0,oslo.utils==4.2.1,oslo.versionedobjects==2.2.0,oslotest==4.3.0,paramiko==2.7.1,Paste==3.4.1,PasteDeploy==2.1.0,pbr==5.4.5,prettytable==0.7.2,psutil==5.7.0,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycadf==3.1.0,pycodestyle==2.5.0,pycparser==2.20,pyflakes==2.1.1,Pygments==2.6.1,pyinotify==0.9.6,PyNaCl==1.4.0,pyOpenSSL==19.1.0,pyparsing==2.4.7,pyperclip==1.8.0,pyroute2==0.5.12,pyrsistent==0.16.0,python-barbicanclient==5.0.0,python-blazarclient==3.1.0,python-dateutil==2.8.1,python-editor==1.0.4,python-glanceclient==3.2.0,python-heatclient==2.2.0,python-keystoneclient==4.1.0,python-mimeparse==1.6.0,python-mistralclient==4.1.0,python-neutronclient==7.2.0,python-novaclient==17.1.0,python-subunit==1.4.0,python-swiftclient==3.10.0,python-tackerclient==1.2.0,pytz==2020.1,PyYAML==5.3.1,repoze.lru==0.7,requests==2.24.0,requests-mock==1.8.0,requests-oauthlib==1.3.0,requestsexceptions==1.4.0,restructuredtext-lint==1.3.1,rfc3986==1.4.0,Routes==2.4.1,rsa==4.6,simplejson==3.17.0,six==1.15.0,soupsieve==2.0.1,SQLAlchemy==1.3.18,sqlalchemy-filters==0.12.0,sqlalchemy-migrate==0.13.0,sqlparse==0.3.1,statsd==3.3.0,stestr==3.0.1,stevedore==2.0.1,-e git+https://opendev.org/openstack/tacker.git@4237fe52046286b339fe7853d69d181f17824dba#egg=tacker,tempest==24.0.0,Tempita==0.5.2,tenacity==6.2.0,testresources==2.0.1,testscenarios==0.5.0,testtools==2.4.0,tooz==2.6.0,tosca-parser==2.1.0,traceback2==1.4.0,unittest2==1.1.0,urllib3==1.25.9,vine==1.3.0,voluptuous==0.11.7,waitress==1.4.4,warlock==1.3.3,wcwidth==0.2.5,WebOb==1.8.6,websocket-client==0.57.0,WebTest==2.0.35,wrapt==1.12.1,yappi==1.2.5,zipp==3.1.0
py36 run-test-pre: PYTHONHASHSEED='934446558'
py36 run-test: commands[0] | stestr run --slowest --concurrency 1 tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file
Could not load 'glance.store.s3.Store': No module named 'boto3'
Could not load 's3': No module named 'boto3'
Could not load 'glance.store.s3.Store': No module named 'boto3'
Could not load 's3': No module named 'boto3'
{0} tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file [0.180895s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/opt/stack/tacker/tacker/tests/unit/vnfm/infra_drivers/openstack/test_openstack_driver.py", line 890, in test_pre_instantiation_vnf_image_with_file
    self.assertEqual(get_image_url.call_count, 2)

      File "/opt/stack/tacker/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 415, in assertEqual
    self.assertThat(observed, matcher, message)

      File "/opt/stack/tacker/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 502, in assertThat
    raise mismatch_error

    testtools.matchers._impl.MismatchError: 1 != 2

sys:1: ResourceWarning: unclosed file <_io.FileIO name=1 mode='wb' closefd=True>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmpl8kpvsak/tmphcwwc07n'>

==============================
Failed 1 tests - output below:
==============================

tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file
-----------------------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/opt/stack/tacker/tacker/tests/unit/vnfm/infra_drivers/openstack/test_openstack_driver.py", line 890, in test_pre_instantiation_vnf_image_with_file
    self.assertEqual(get_image_url.call_count, 2)

      File "/opt/stack/tacker/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 415, in assertEqual
    self.assertThat(observed, matcher, message)

      File "/opt/stack/tacker/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 502, in assertThat
    raise mismatch_error

    testtools.matchers._impl.MismatchError: 1 != 2

======
Totals
======
Ran: 1 tests in 0.1809 sec.
 - Passed: 0
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1
Sum of execute time for each test: 0.1809 sec.

==============
Worker Balance
==============
 - Worker 0 (1 tests) => 0:00:00.180895
Test id Runtime (s)
----------------------------------------------------------------------------------------------------------------------------- -----------
tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file 0.181
ERROR: InvocationError for command /opt/stack/tacker/.tox/py36/bin/stestr run --slowest --concurrency 1 tacker.tests.unit.vnfm.infra_drivers.openstack.test_openstack_driver.TestOpenStack.test_pre_instantiation_vnf_image_with_file (exited with code 1)
_____________________________________________________________________________________ summary _____________________________________________________________________________________
ERROR: py36: commands failed

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.opendev.org/738393

Changed in tacker:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/738393
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=ad686ab84698ad0b7dc14a3463cf1b2e3107ea5f
Submitter: Zuul
Branch: master

commit ad686ab84698ad0b7dc14a3463cf1b2e3107ea5f
Author: Yasufumi Ogawa <email address hidden>
Date: Mon Jun 29 07:38:41 2020 +0000

    Fix failed test for creating vnf image

    The number of getting image URL is expected as `2`, but notactually
    in test_pre_instantiation_vnf_image_with_file(). The value can be `1`
    or `2` for `tox -e py36` or `tox -e lower-constraints`. It might be
    because of a difference of versions of modules imported in
    the test cases.

    This update is just a quick fixing to avoid the issue. So, it could be
    happened again possibly if the versions of modules are changed.

    Closes-Bug: #1885523

    Change-Id: I302607f636d6d96baa544ccad600bb21fdf18da2
    Signed-off-by: Yasufumi Ogawa <email address hidden>

Changed in tacker:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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