From 003ff46a98511e8bf34c81d24a1c74152987c86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 28 Jun 2022 14:17:00 +0200 Subject: [PATCH] tests/xwayland: Wait for clipboard to settle before killing Xwayland The test aims to test that trying to fetch X11 clipboard content after Xwayland went away doesn't cause issues. What happens though is that sometimes the clipboard content doesn't have time to settle (i.e. fetch mime types etc) before Xwayland gets terminated, which causes flakyness. Fix this by waiting for the compositor side clipboard owners to finish setting up before continuing. Part-of: --- src/tests/xwayland-tests.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tests/xwayland-tests.c b/src/tests/xwayland-tests.c index 9cdce37a3..bcd356b37 100644 --- a/src/tests/xwayland-tests.c +++ b/src/tests/xwayland-tests.c @@ -122,6 +122,8 @@ meta_test_xwayland_restart_selection (void) tests_alarm_filter, test_client); + g_assert_null (x11_display->selection.owners[META_SELECTION_CLIPBOARD]); + test_client_do_check (test_client, "create", window_name, NULL); @@ -130,6 +132,9 @@ meta_test_xwayland_restart_selection (void) NULL); test_client_wait_check (test_client); + while (!x11_display->selection.owners[META_SELECTION_CLIPBOARD]) + g_main_context_iteration (NULL, TRUE); + g_test_expect_message ("libmutter", G_LOG_LEVEL_WARNING, "*Connection to xwayland lost*"); g_test_expect_message ("libmutter", G_LOG_LEVEL_WARNING,