]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
tests: confirm that _output_hosts_file does not log too often
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 20 Apr 2015 15:06:38 +0000 (17:06 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 23 Apr 2015 09:21:15 +0000 (11:21 +0200)
commit38211ae67cb76ade85b08c028b6e88bfc867afc9
tree9ad31809572787e6b1de22f12b4786bedd89f746
parenta0d896328672ae9e1ac948320bbbe89345696e62
tests: confirm that _output_hosts_file does not log too often

I3ad7864eeb2f959549ed356a1e34fa18804395cc didn't include any regression unit
tests to validate that the method won't ever log too often again,
reintroducing performance drop in later patches. It didn't play well
with stable backports of the fix, where context was lost when doing the
backport, that left the bug unfixed in stable/juno even though the patch
was merged there [1].

The patch adds an explicit note in the code that suggests not to add new
log messages inside the loop to avoid regression, and a unit test was
added to capture it.

Once the test is merged in master, it will be proposed for stable/juno
inclusion, with additional changes that would fix the regression again.

Related-Bug: #1414218
Change-Id: I5d43021932d6a994638c348eda277dd8337cf041
(cherry picked from commit 3b74095a935f6d2027e6bf04cc4aa21f8a1b46f2)
neutron/agent/linux/dhcp.py
neutron/tests/unit/agent/linux/test_dhcp.py