tests fail with networkx 2.4: "AttributeError: 'DiGraph' object has no attribute 'node'"

Bug #1848499 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Balazs Gibizer

Bug Description

https://c6fecb2db5c55fa0effa-6229cc6450d9b491384804026d2fbd81.ssl.cf5.rackcdn.com/688980/1/gate/openstack-tox-py36/71a8bdd/testr_results.html.gz

ft1.2: nova.tests.unit.virt.powervm.tasks.test_vm.TestVMTasks.test_power_on_revert_StringException: Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/mock/mock.py", line 1330, in patched
    return func(*args, **keywargs)
  File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/unit/virt/powervm/tasks/test_vm.py", line 90, in test_power_on_revert
    self.assertRaises(ValueError, tf_eng.run, flow)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 485, in assertRaises
    self.assertThat(our_callable, matcher)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 496, in assertThat
    mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 547, in _matchHelper
    mismatch = matcher.match(matchee)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/matchers/_exception.py", line 108, in match
    mismatch = self.exception_matcher.match(exc_info)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/matchers/_higherorder.py", line 62, in match
    mismatch = matcher.match(matchee)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 475, in match
    reraise(*matchee)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/_compat3x.py", line 16, in reraise
    raise exc_obj.with_traceback(exc_tb)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/matchers/_exception.py", line 101, in match
    result = matchee()
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 1049, in __call__
    return self._callable_object(*self._args, **self._kwargs)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/helpers.py", line 162, in run
    engine.run()
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/action_engine/engine.py", line 247, in run
    for _state in self.run_iter(timeout=timeout):
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/action_engine/engine.py", line 271, in run_iter
    self.compile()
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/fasteners/lock.py", line 306, in wrapper
    return f(self, *args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/action_engine/engine.py", line 470, in compile
    self._runtime.compile()
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/action_engine/runtime.py", line 143, in compile
    metadata['edge_deciders'] = tuple(deciders_it)
  File "/home/zuul/src/opendev.org/openstack/nova/.tox/py36/lib/python3.6/site-packages/taskflow/engines/action_engine/runtime.py", line 75, in _walk_edge_deciders
    u_node_kind = graph.node[u_node]['kind']
AttributeError: 'DiGraph' object has no attribute 'node'

Seems this is since networkx 2.4 was released 11 hours ago:

https://pypi.org/project/networkx/2.4/

And upper-constraints aren't being honored for some reason:

networkx===2.2;python_version=='2.7'
networkx===2.3;python_version=='3.4'
networkx===2.3;python_version=='3.5'
networkx===2.3;python_version=='3.6'
networkx===2.3;python_version=='3.7'

I guess maybe because they are a transitive dependency of taskflow which the powervm driver depends on?

Tags: gate-failure
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
status: Confirmed → In Progress
Matt Riedemann (mriedem)
summary: - powervm driver tests fail with networkx 2.4: "AttributeError: 'DiGraph'
- object has no attribute 'node'"
+ tests fail with networkx 2.4: "AttributeError: 'DiGraph' object has no
+ attribute 'node'"
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/689152
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=be09b73796b2aa22d0888d98eb29315f2f4786ab
Submitter: Zuul
Branch: master

commit be09b73796b2aa22d0888d98eb29315f2f4786ab
Author: Balazs Gibizer <email address hidden>
Date: Thu Oct 17 15:28:14 2019 +0200

    Make sure tox install requirements.txt with upper-constraints

    Ieb4ab13cf8ca5683fcd7b18ed669e8a26659bff1 removed the upper-constraints
    from the install_command which caused that only the test-requirements
    are installed with the upper-constraints enforced. This caused that when
    tox installed nova in the virtual env it installed the content of the
    requirement.txt without enforcing the upper-constraints. Today networkx
    2.4 package has been released to pypi. The taskflow lib depends on
    networkx but does not pin the requirement but the openstack
    upper-constraints pins the networkx requirements properly. Nova depends
    on taskflow therefore when nova is installed by tox without the
    upper-constraints the new networkx 2.4 is installed. This broke the nova
    unit tests.

    This patch makes sure that all the requirements are installed with the
    upper-constraints enforced.

    Change-Id: Iba797243d2a137b551223165a1af1a8676bcea02
    Closes-Bug: #1848499

Changed in nova:
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