[glib/wip/hadess/fix-assert-eventually] gio: Fix conditions in memory-monitor test
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/hadess/fix-assert-eventually] gio: Fix conditions in memory-monitor test
- Date: Mon, 6 Sep 2021 12:30:24 +0000 (UTC)
commit 272e7b010a6265d1461335f15a1c384c3d0fb69d
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 6 14:28:25 2021 +0200
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:
https://github.com/GNOME/glib/commit/96a8c02d240d7c9ae366c63771291413384bdfb7#r54773831
gio/tests/memory-monitor-dbus.py.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in
index e8ac28faf..bf3291847 100755
--- a/gio/tests/memory-monitor-dbus.py.in
+++ b/gio/tests/memory-monitor-dbus.py.in
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]