When running in a VM (UML time-travel to be exact), it may happen that
not enough time passes and the 5 ms timeout for property notification
causes compression of events. However, some tests will check that all
property notifications were done and this compression can cause test
failures.
Work around this by simply inserting a 5 ms sleep for any signal handler
call.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
s.remove()
def add_signal(self, handler, interface, name, byte_arrays=False):
- s = self.bus.add_signal_receiver(handler, dbus_interface=interface,
+ # Insert sleep to ensure WPA_DBUS_SEND_PROP_CHANGED_TIMEOUT passes
+ def int_handler(*args):
+ nonlocal handler
+ time.sleep(0.005)
+ handler(*args)
+
+ s = self.bus.add_signal_receiver(int_handler, dbus_interface=interface,
signal_name=name,
byte_arrays=byte_arrays)
self.signals.append(s)