mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
tests: Wait for LMM server to be available when starting test
Otherwise the test can go on to wait for a signal from the service before it’s actually finished starting up. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #2887
This commit is contained in:
parent
1f2d9e69c9
commit
e0276a3a17
@ -57,6 +57,14 @@ try:
|
||||
fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
|
||||
self.last_warning = -1
|
||||
self.dbusmock = dbus.Interface(self.obj_lmm, dbusmock.MOCK_IFACE)
|
||||
|
||||
try:
|
||||
self.wait_for_bus_object('org.freedesktop.LowMemoryMonitor',
|
||||
'/org/freedesktop/LowMemoryMonitor',
|
||||
system_bus=True)
|
||||
except:
|
||||
raise
|
||||
|
||||
self.memory_monitor = Gio.MemoryMonitor.dup_default()
|
||||
assert("GMemoryMonitorDBus" in str(self.memory_monitor))
|
||||
self.memory_monitor.connect("low-memory-warning", self.memory_warning_cb)
|
||||
|
Loading…
Reference in New Issue
Block a user