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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2484>
This commit is contained in:
Jonas Ådahl 2022-06-28 14:17:00 +02:00 committed by Marge Bot
parent 973b94ae46
commit 003ff46a98

View File

@ -122,6 +122,8 @@ meta_test_xwayland_restart_selection (void)
tests_alarm_filter, tests_alarm_filter,
test_client); test_client);
g_assert_null (x11_display->selection.owners[META_SELECTION_CLIPBOARD]);
test_client_do_check (test_client, test_client_do_check (test_client,
"create", window_name, "create", window_name,
NULL); NULL);
@ -130,6 +132,9 @@ meta_test_xwayland_restart_selection (void)
NULL); NULL);
test_client_wait_check (test_client); 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, g_test_expect_message ("libmutter", G_LOG_LEVEL_WARNING,
"*Connection to xwayland lost*"); "*Connection to xwayland lost*");
g_test_expect_message ("libmutter", G_LOG_LEVEL_WARNING, g_test_expect_message ("libmutter", G_LOG_LEVEL_WARNING,