hwmon: Lower poll timeout during tests

Makes the tests last about 8 seconds less.
This commit is contained in:
Bastien Nocera
2021-01-20 17:18:04 +01:00
parent e8d22fe304
commit 7591a2a76e
2 changed files with 5 additions and 3 deletions

View File

@@ -14,7 +14,9 @@
#include <errno.h>
#include <stdio.h>
#define DEFAULT_POLL_TIME 8000
#include "utils.h"
#define DEFAULT_POLL_TIME (IS_TEST ? 500 : 8000)
#define MAX_LIGHT_LEVEL 255
typedef struct DrvData {

View File

@@ -256,8 +256,8 @@ class Tests(dbusmock.DBusTestCase):
self.assertEqual(self.get_dbus_property('LightLevelUnit'), 'vendor')
self.testbed.set_attribute(hwmon, 'light', '(255,255)')
# DEFAULT_POLL_TIME is 8000
time.sleep(8)
# DEFAULT_POLL_TIME
time.sleep(0.5)
self.assertEventually(lambda: self.get_dbus_property('LightLevel') == 100)
# process = subprocess.Popen(['gdbus', 'introspect', '--system', '--dest', 'net.hadess.SensorProxy', '--object-path', '/net/hadess/SensorProxy'])