Change in vdsm[master]: fixing race while sampling interfaces

ibarkan at redhat.com ibarkan at redhat.com
Mon Dec 22 15:46:18 UTC 2014


Ido Barkan has posted comments on this change.

Change subject: fixing race while sampling interfaces
......................................................................


Patch Set 7:

(2 comments)

http://gerrit.ovirt.org/#/c/36138/7/tests/samplingTests.py
File tests/samplingTests.py:

Line 127:     finally:
Line 128:         try:
Line 129:             ipwrapper.linkDel(name)
Line 130:         except ipwrapper.IPRoute2Error:
Line 131:             pass
> why could this fail? Why would we want to hide this failure?
this is actually expected to fail if the test goes well. note that NastyInterfaceSample is challenging it's creator by removing the link (in this case, the vlan) so by the time the finally block is executed, the vlan device is probably not there.

In the general case (future uses) it might be surprising to the user. Maybe we can fix it only when needed
Line 132: 
Line 133: 
Line 134: class InterfaceSampleTests(TestCaseBase):
Line 135:     NEW_INTERFACE = 'newinterface'


Line 146:     def testHostSampleReportsNewInterface(self):
Line 147:         hs_before = sampling.HostSample(os.getpid())
Line 148:         interfaces_before = set(hs_before.interfaces.iterkeys())
Line 149: 
Line 150:         with dummy(self.NEW_INTERFACE):
> actually, that module does a very ugly limited kind of randomness, but yes,
improved randomness in a different patch. Petr is right. But moving dummyIf from networkTest was to much work (and it's not what I need) so I used dummy module directly.
Line 151:             hs_after = sampling.HostSample(os.getpid())
Line 152:             interfaces_after = set(hs_after.interfaces.iterkeys())
Line 153:             interfaces_diff = interfaces_after - interfaces_before
Line 154:             self.assertEqual(interfaces_diff, set([self.NEW_INTERFACE]))


-- 
To view, visit http://gerrit.ovirt.org/36138
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I059a5bfa4c140d88f512dc9a51d18f02956710de
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list