[gnome-settings-daemon/benzea/python3-update: 3/4] power: Make power test more robust
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/benzea/python3-update: 3/4] power: Make power test more robust
- Date: Thu, 19 Jul 2018 10:42:33 +0000 (UTC)
commit da20498b6244a8f897f5dead08ee816d7870dbbd
Author: Benjamin Berg <bberg redhat com>
Date: Mon Apr 30 12:27:24 2018 +0200
power: Make power test more robust
Reset the idle time and wait for lid inhibition to be removed.
This should make the test more reliable avoiding some potential race
conditions.
plugins/power/test.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index eaa5341b..82f46c58 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -739,7 +739,12 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
def test_dim(self):
'''Check that we do go to dim'''
+ # Wait and flush log
+ time.sleep (gsdpowerconstants.LID_CLOSE_SAFETY_TIMEOUT + 1)
+ self.plugin_log.read()
+
idle_delay = round(gsdpowerconstants.MINIMUM_IDLE_DIM_DELAY /
gsdpowerconstants.IDLE_DELAY_TO_IDLE_DIM_MULTIPLIER)
+ self.reset_idle_timer()
self.settings_session['idle-delay'] = idle_delay
self.settings_gsd_power['sleep-inactive-battery-timeout'] = idle_delay + 1
@@ -751,7 +756,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
self.assertEqual(self.get_status(), gsdpowerenums.GSM_PRESENCE_STATUS_AVAILABLE)
# Wait and check we're not idle, but dimmed
- self.check_dim(gsdpowerconstants.MINIMUM_IDLE_DIM_DELAY)
+ self.check_dim(gsdpowerconstants.MINIMUM_IDLE_DIM_DELAY + 1)
# Give time for the brightness to change
time.sleep(2)
level = self.get_brightness();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]