mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-08 08:58:01 +02:00
tests: Fix one of the tests for slower machines
======================================================================
FAIL: test_intel_pstate_balance (__main__.Tests)
Intel P-State driver (balance)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/power-profiles-daemon-0.1/tests/integration-test", line 375, in test_intel_pstate_balance
self.assertEqual(contents, b'balance_power')
AssertionError: b'' != b'balance_power'
----------------------------------------------------------------------
This commit is contained in:
parent
95a67713cf
commit
d6ef7bcfc8
1 changed files with 6 additions and 3 deletions
|
|
@ -208,6 +208,11 @@ class Tests(dbusmock.DBusTestCase):
|
|||
return f.read()
|
||||
return None
|
||||
|
||||
def read_file(self, path):
|
||||
with open(path, 'rb') as f:
|
||||
return f.read()
|
||||
return None
|
||||
|
||||
def assertEventually(self, condition, message=None, timeout=50):
|
||||
'''Assert that condition function eventually returns True.
|
||||
|
||||
|
|
@ -370,9 +375,7 @@ class Tests(dbusmock.DBusTestCase):
|
|||
obj_upower.EmitSignal('', 'Changed', '', [], dbus_interface='org.freedesktop.DBus.Mock')
|
||||
|
||||
contents = None
|
||||
with open(os.path.join(dir1, "energy_performance_preference"), 'rb') as f:
|
||||
contents = f.read()
|
||||
self.assertEqual(contents, b'balance_power')
|
||||
self.assertEventually(lambda: self.read_file(os.path.join(dir1, "energy_performance_preference")) == b'balance_power')
|
||||
|
||||
self.stop_daemon()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue