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
This commit is contained in:
Jonas Ådahl 2020-06-05 00:03:00 +02:00
parent f61d4b4e70
commit 8d84449941

View File

@ -572,6 +572,9 @@ test_case_do (TestCase *test,
if (!test_client_do (client, error, argv[0], window_id, NULL)) if (!test_client_do (client, error, argv[0], window_id, NULL))
return FALSE; return FALSE;
if (!test_case_wait (test, error))
return FALSE;
MetaWindow *window = test_client_find_window (client, window_id, error); MetaWindow *window = test_client_find_window (client, window_id, error);
if (!window) if (!window)
return FALSE; return FALSE;