From 7992b46566b3a37dbe1a27fee1cb67eb6dc612ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 25 Nov 2021 10:21:05 +0100 Subject: [PATCH] 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: --- src/tests/wayland-test-clients/invalid-xdg-shell-actions.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/wayland-test-clients/invalid-xdg-shell-actions.c b/src/tests/wayland-test-clients/invalid-xdg-shell-actions.c index 67ff3671e..da9a6b971 100644 --- a/src/tests/wayland-test-clients/invalid-xdg-shell-actions.c +++ b/src/tests/wayland-test-clients/invalid-xdg-shell-actions.c @@ -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; }