mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 08:48:05 +02:00
test: Disable battery polling to make test more stable
Otherwise the fast repolling can get in-between, cause extra logging and trigger a failure.
This commit is contained in:
parent
1a9541814e
commit
54e396e7ae
1 changed files with 10 additions and 1 deletions
|
|
@ -631,7 +631,14 @@ class Tests(dbusmock.DBusTestCase):
|
|||
'capacity', '40',
|
||||
'voltage_now', '12000000'], [])
|
||||
|
||||
self.start_daemon(warns=True)
|
||||
config = tempfile.NamedTemporaryFile(delete=False, mode='w')
|
||||
# The unknown poll can cause issues for test synchronization
|
||||
config.write("[UPower]\n")
|
||||
config.write("NoPollBatteries=true\n")
|
||||
config.close()
|
||||
self.addCleanup(os.unlink, config.name)
|
||||
|
||||
self.start_daemon(config.name, warns=True)
|
||||
devs = self.proxy.EnumerateDevices()
|
||||
self.assertEqual(len(devs), 2)
|
||||
|
||||
|
|
@ -665,6 +672,8 @@ class Tests(dbusmock.DBusTestCase):
|
|||
# The table should be mirrored
|
||||
assert display_device_state[i][j] == display_device_state[j][i]
|
||||
|
||||
print(f'Test states are {states[i]} and {states[j]} expected state is {states[display_device_state[i][j]]}')
|
||||
|
||||
self.testbed.set_attribute(bat0, 'status', states[i])
|
||||
self.testbed.set_attribute(bat1, 'status', states[j])
|
||||
self.testbed.uevent(bat0, 'change')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue