From dd0b437d866878faa4672518b4b732e8ac00aa30 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 22 Oct 2019 09:29:41 -0500 Subject: [PATCH] trivial: fu-self-test: set polling self tests to slow Currently the test runs for 100ms and looks to see that at least 8 times the poll function callback hit. This normally works well enough, but during self tests it depends upon too much timing and leads to failures sometimes: ``` ** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.189: poll cnt=0 *# DEBUG: poll cnt=1 ** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.199: poll cnt=1 *** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.209: poll cnt=2 ** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.227: poll cnt=3 *# DEBUG: poll cnt=4 ** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.255: poll cnt=4 *# DEBUG: poll cnt=5 ** (/<>/obj-s390x-linux-gnu/src/fu-self-test:50432): DEBUG: 15:37:55.267: poll cnt=5 Bail out! ERROR:../src/fu-self-test.c:3489:fu_device_poll_func: assertion failed (cnt >= 8): (6 >= 8) --- stderr --- ** ERROR:../src/fu-self-test.c:3489:fu_device_poll_func: assertion failed (cnt >= 8): (6 >= 8) ------- ``` Mark this as a slow test so that it doesn't cause CI failures. --- src/fu-self-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fu-self-test.c b/src/fu-self-test.c index 869b76fc5..2f4a83aa8 100644 --- a/src/fu-self-test.c +++ b/src/fu-self-test.c @@ -4149,7 +4149,8 @@ main (int argc, char **argv) g_test_add_func ("/fwupd/archive{cab}", fu_archive_cab_func); g_test_add_func ("/fwupd/engine{requirements-other-device}", fu_engine_requirements_other_device_func); g_test_add_func ("/fwupd/device{incorporate}", fu_device_incorporate_func); - g_test_add_func ("/fwupd/device{poll}", fu_device_poll_func); + if (g_test_slow ()) + g_test_add_func ("/fwupd/device{poll}", fu_device_poll_func); g_test_add_func ("/fwupd/device-locker{success}", fu_device_locker_func); g_test_add_func ("/fwupd/device-locker{fail}", fu_device_locker_fail_func); g_test_add_func ("/fwupd/device{metadata}", fu_device_metadata_func);