Merge branch 'wip/hadess/fix-assert-eventually' into 'main'

gio: Fix conditions in memory-monitor test

See merge request GNOME/glib!2240
This commit is contained in:
Philip Withnall 2021-09-06 13:07:19 +00:00
commit 5b90f9d088
2 changed files with 4 additions and 4 deletions

View File

@ -99,11 +99,11 @@ try:
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
self.assertEventually(self.last_warning == 100, "'100' low-memory warning not received", 20)
self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
self.assertEventually(self.last_warning == 255, "'255' low-memory warning not received", 20)
self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)

View File

@ -117,11 +117,11 @@ try:
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
self.assertEventually(self.last_warning == 100, "'100' low-memory warning not received", 20)
self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
self.assertEventually(self.last_warning == 255, "'255' low-memory warning not received", 20)
self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)