From 8d84449941b189f9fe5d4be0a50699d3c6e00ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 5 Jun 2020 00:03:00 +0200 Subject: [PATCH] test-runner: Wait before finding MetaWindow when showing A "show" command calls gtk_window_show() and gdk_display_sync(), then returns. This means that the X11 window objects are guaranteed to have been created in the X11 server. After that, the test runner will look up the window's associated MetaWindow and wait for it to be shown. What this doesn't account for is if mutter didn't get enough CPU time to see the new window. When this happens, the 'default-size' stacking test sometimes failed after hiding and showing the X11 window. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1288 --- src/tests/test-runner.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index f1c605ad6..577c4dcae 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -572,6 +572,9 @@ test_case_do (TestCase *test, if (!test_client_do (client, error, argv[0], window_id, NULL)) return FALSE; + if (!test_case_wait (test, error)) + return FALSE; + MetaWindow *window = test_client_find_window (client, window_id, error); if (!window) return FALSE;