]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Cancelling thread start while unit tests running
authorEvgeny Fedoruk <evgenyf@radware.com>
Tue, 18 Mar 2014 17:55:11 +0000 (10:55 -0700)
committerEvgeny Fedoruk <evgenyf@radware.com>
Fri, 28 Mar 2014 16:20:55 +0000 (09:20 -0700)
commitd52f84d96a2fadcf90fdac7a3e265c45d2ec234a
treed3efeac1552358a02f7d078e29bf07e8356e790c
parentb76c9e888824ec0c6a42a5a01e1d5022f1eb02b9
Cancelling thread start while unit tests running

This change modifies the Radware driver and its unit testing code
to not start operations completion thread while unit tests are running.

The driver initialization changed not to start the operations completion thread,
the thread is started only when operation completion item is inserted into the queue
for the first time.
The operation completion functionality was moved to a new function which
is called by the operations completion thread run() function.
The run() function still have the functionality of popping operation completion
items out of the queue and push failed items back.

Unit testing code mocks the operation completion items queue
by calling the operations completion hanler new function when item
is added.

Start() and join() functions of the thread were mocked to do nothing.

All sleep() entrances were removed from the unit testing code.
All unnecessary mock_reset() calls were removed.

Change-Id: I72380bf223be690831aba1fc29c3dca910245516
Closes-Bug: #1245208
neutron/services/loadbalancer/drivers/radware/driver.py
neutron/tests/unit/services/loadbalancer/drivers/radware/test_plugin_driver.py