← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1809643] Re: Unit tests using fake_port1 and fake_port2 global variables are flaky

 

Reviewed:  https://review.openstack.org/627087
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e83e5618b7ca71fb96bf460922480b9808b431b6
Submitter: Zuul
Branch:    master

commit e83e5618b7ca71fb96bf460922480b9808b431b6
Author: aojeagarcia <aojeagarcia@xxxxxxxx>
Date:   Sun Dec 23 23:43:38 2018 +0100

    Don't modify global variables in unit tests
    
    The unit test
    test_enable_dhcp_helper_enable_metadata_nonisolated_dist_network
    modifies the global variables fake_port1, fake_port2, creating flakiness
    on unit tests that use those variables when execured in environments
    with high concurrency.
    
    Creating a deepcopy of the variable avoid that those changes can be
    propagated to other unit tests.
    
    Closes-Bug: #1809643
    
    Change-Id: Idfd0e99739952baf4d7b545b406cd1b251deb5f8
    Signed-off-by: aojeagarcia <aojeagarcia@xxxxxxxx>


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1809643

Title:
  Unit tests using fake_port1 and fake_port2 global variables are flaky

Status in neutron:
  Fix Released

Bug description:
  The unit test
  test_enable_dhcp_helper_enable_metadata_nonisolated_dist_network
  modifies the global variables fake_port1, fake_port2, creating
  flakiness on unit tests that use those variables when execured in
  environments with high concurrency.

  How to reproduce:

  Run unit tests on following patch
  https://review.openstack.org/#/c/626641 with the following commands:

  source .tox/py27/bin/activate
  stestr run --concurrency=12 --until-failure neutron.tests.unit.agent.dhcp.test_agent.TestDhcpAgentEventHandler

  After several iterations, the test port_create_end fails. Debugging
  the failure you can see that the ports that fail are different than
  the configured in the global variables, they have been modified by
  test_enable_dhcp_helper_enable_metadata_nonisolated_dist_network

  Reference: https://rbtcollins.wordpress.com/2015/12/02/diagnosing-
  flaky-tests/

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1809643/+subscriptions


References