From 575943e744fd97062d94d83294a10eb203f22bdf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 21 Aug 2020 15:17:10 +1000 Subject: [PATCH] test: add another dispatch for the suspend test In case the RESUMED isn't written on the wire yet (or it's written with sendmsg and thus a separate message on its own) we don't have the RESUMED ready for us yet. Let's call another dispatch to make sure it's processed. Signed-off-by: Peter Hutterer --- test/test-eis.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test-eis.c b/test/test-eis.c index 1554206..7680e79 100644 --- a/test/test-eis.c +++ b/test/test-eis.c @@ -144,6 +144,11 @@ MUNIT_TEST(eistest_device_resume_suspend_twice) _cleanup_ei_event_ struct ei_event *added = peck_ei_next_event(ei, EI_EVENT_DEVICE_ADDED); + /* _until_stable() may stop after DEVICE_ADDED since it's + * punting to the caller, so we need another dispatch to + * make sure the RESUMED is really waiting for us here */ + ei_dispatch(ei); + _cleanup_ei_event_ struct ei_event *resumed = peck_ei_next_event(ei, EI_EVENT_DEVICE_RESUMED);