LBaaS: unit tests for radware plugin driver should not employ multithreading

Bug #1245208 reported by Eugene Nikanorov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Evgeny Fedoruk

Bug Description

Radware plugin driver uses task queue to perform interaction with the backend device.
Several operations such as lbaas objects deletion are performed in async manner.
In the unit test code actual object deletion happens in separate thread; it leads to a need for tricks like putting test thread to sleep.
Such unit tests are not reliable and could lead to failures that are hard to catch or debug.

Unit test code should be refactored in such way that it uses single-threaded strategy to perform driver operations.

Tags: lbaas radware
description: updated
affects: python-neutronclient → neutron
Changed in neutron:
importance: Undecided → Low
Bo Lin (linb)
Changed in neutron:
assignee: nobody → berlin (linb)
Changed in neutron:
importance: Low → Medium
Changed in neutron:
status: New → Triaged
Changed in neutron:
assignee: berlin (linb) → nobody
Evgeny Fedoruk (evgenyf)
Changed in neutron:
assignee: nobody → Evgeny Fedoruk (evgenyf)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/81323

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

Reviewed: https://review.openstack.org/81323
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=d52f84d96a2fadcf90fdac7a3e265c45d2ec234a
Submitter: Jenkins
Branch: master

commit d52f84d96a2fadcf90fdac7a3e265c45d2ec234a
Author: Evgeny Fedoruk <email address hidden>
Date: Tue Mar 18 10:55:11 2014 -0700

    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

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
no longer affects: neutron/icehouse
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
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.