Change in vdsm[master]: netlink: event monitor

phoracek at redhat.com phoracek at redhat.com
Fri Jan 16 09:54:30 UTC 2015


Petr Horáček has posted comments on this change.

Change subject: netlink: event monitor
......................................................................


Patch Set 22:

(2 comments)

http://gerrit.ovirt.org/#/c/36197/22/tests/netlinkTests.py
File tests/netlinkTests.py:

Line 27:         """Tests if monitor is able to catch event while iterating. Before the
Line 28:         iteration we start _add_device, which is delayed for .2 second. Then
Line 29:         iteration starts and waits for new dummy."""
Line 30:         def _add_device():
Line 31:             time.sleep(.2)
> here is a place to use threading.Event(). wait() for it here, and set() ins
it probably will not reach the set() because there will be no events yielded
Line 32:             dummy_name = dummy.create(prefix='dummy_mon_')
Line 33:             dummy.remove(dummy_name)
Line 34:         add_device_thread = threading.Thread(target=_add_device)
Line 35: 


Line 35: 
Line 36:         with _timed_monitor(1) as mon:
Line 37:             add_device_thread.start()
Line 38:             for event in mon:
Line 39:                 if 'dummy_mon_' in event.get('name'):
> why aren't you waiting for the exact dummy_name ?
because of dummy package generates random suffix and dummy's name is returned inside another thread
Line 40:                     break
Line 41:             add_device_thread.join()
Line 42: 
Line 43:     @ValidateRunningAsRoot


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0f4fcfde87ad51eb832f54862371b4da1281826e
Gerrit-PatchSet: 22
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken 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