mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
gio: Fix conditions in memory-monitor test
We were lucky that this worked in some cases (the test is racy), but we
should actually run the condition check each loop, rather than when the
function is called.
Spotted by Martin Pitt:
96a8c02d24 (r54773831)
This commit is contained in:
parent
93ec31e973
commit
e1819c42fb
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user