tests/invalid-xdg-shell-actions: Avoid flakyness

The roundtrip in the handle-configure function could in theory (and in
practice in the future) happen to receive another configure event. If we
send yet another invalid geometry the second time, we log one time too
many in the server, which fails the test. Avoid this by ignoring the
second configure event; it's enough to pass through the error handling
path once.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>
This commit is contained in:
Jonas Ådahl 2021-11-25 10:21:05 +01:00 committed by Marge Bot
parent 4469042e2a
commit 7992b46566

View File

@ -173,10 +173,17 @@ handle_xdg_surface_configure (void *data,
struct xdg_surface *xdg_surface,
uint32_t serial)
{
static gboolean sent_invalid_once = FALSE;
if (sent_invalid_once)
return;
xdg_surface_set_window_geometry (xdg_surface, 0, 0, 0, 0);
draw_main ();
wl_surface_commit (surface);
sent_invalid_once = TRUE;
g_assert_cmpint (wl_display_roundtrip (display), !=, -1);
running = FALSE;
}