periodic task runs during nova.tests.unit.compute.test_compute unit test

Bug #1403051 reported by Daniel Berrange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

While running the nova.tests.unit.compute.test_compute unit test, I noticed that it throws a lot of exceptions, which don't actually cause the test suite to report failure. It appears that these are caused by some periodic background task being executed. Such tasks should be disabled in unit tests, as they'll often lead to non-deterministic behaviour and/or failure.

Traceback (most recent call last):
  File "/home/berrange/src/cloud/nova/.venv/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 455, in fire_timers
    timer()
  File "/home/berrange/src/cloud/nova/.venv/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "nova/utils.py", line 946, in wrapper
    return func(*args, **kwargs)
  File "nova/conductor/manager.py", line 651, in build_instances
    instance.uuid, request_spec)
  File "nova/scheduler/driver.py", line 67, in handle_schedule_error
    'task_state': None})
  File "nova/db/api.py", line 786, in instance_update_and_get_original
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 145, in wrapper
    return f(*args, **kwargs)
  File "nova/db/sqlalchemy/api.py", line 2408, in instance_update_and_get_original
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 183, in wrapped
    return f(*args, **kwargs)
  File "nova/db/sqlalchemy/api.py", line 2447, in _instance_update
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 1688, in _instance_get_by_uuid
    raise exception.InstanceNotFound(instance_id=uuid)
InstanceNotFound: Instance 3f41eea9-009f-47a6-91a8-9dd797c8f7dd could not be found.
Traceback (most recent call last):
  File "/home/berrange/src/cloud/nova/.venv/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 455, in fire_timers
    timer()
  File "/home/berrange/src/cloud/nova/.venv/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "nova/utils.py", line 946, in wrapper
    return func(*args, **kwargs)
  File "nova/conductor/manager.py", line 651, in build_instances
    instance.uuid, request_spec)
  File "nova/scheduler/driver.py", line 67, in handle_schedule_error
    'task_state': None})
  File "nova/db/api.py", line 786, in instance_update_and_get_original
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 145, in wrapper
    return f(*args, **kwargs)
  File "nova/db/sqlalchemy/api.py", line 2408, in instance_update_and_get_original
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 183, in wrapped
    return f(*args, **kwargs)
  File "nova/db/sqlalchemy/api.py", line 2447, in _instance_update
    columns_to_join=columns_to_join)
  File "nova/db/sqlalchemy/api.py", line 1688, in _instance_get_by_uuid
    raise exception.InstanceNotFound(instance_id=uuid)

Revision history for this message
Hans Lindgren (hanlind) wrote :

This is not caused by periodic tasks but from tests that don't mock calls to build_instances(), which results in a separate thread being spawned.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Confirming that it's not periodic tasks, we disabled those in unit tests back in Juno:

http://git.openstack.org/cgit/openstack/nova/tree/nova/test.py?id=2014.2#n324

That was moved here in Kilo:

http://git.openstack.org/cgit/openstack/nova/tree/nova/tests/unit/conf_fixture.py#n65

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.