From b5a59ec109c889f23d239c43e29a09b2d4744051 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Wed, 18 Oct 2023 07:41:34 +0200 Subject: [PATCH] tests/clutter/event-delivery: Avoid race with stage update `clutter_actor_destroy()` queues a stage update. Under certain circumstances - i.e. when run in a very slow container - this can race with the stage update triggered by the following `clutter_virtual_input_device_notify_button()`, occasionally resulting in `wait_stage_updated()` to return before the `on_event_return_propagate()` callbacks ran, making the test fail. This notably became more common since 8f27ebf87e (clutter/frame-clock: Start next update ASAP after idle period) landed. Thus wait for a stage update to happen after `clutter_actor_destroy()`, preventing the race. Fixes: f6da583d06 (tests/clutter/event-delivery: Add tests for implicit grabbing) Part-of: --- src/tests/clutter/conform/event-delivery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/clutter/conform/event-delivery.c b/src/tests/clutter/conform/event-delivery.c index 383ad0bae..3b259139a 100644 --- a/src/tests/clutter/conform/event-delivery.c +++ b/src/tests/clutter/conform/event-delivery.c @@ -329,6 +329,7 @@ event_delivery_implicit_grab_cancelled (void) n_child_1_leave_events = n_child_2_leave_events = n_stage_leave_events = 0; n_action_sequences_cancelled = 0; clutter_actor_destroy (child_1); + wait_stage_updated (&was_updated); g_assert_cmpint (n_child_1_enter_events, ==, 0); g_assert_cmpint (n_child_1_leave_events, ==, 0); g_assert_cmpint (n_action_sequences_cancelled, ==, 1);