Fix flaky popup test

Related: RHEL-144942
This commit is contained in:
Jonas Ådahl 2026-02-17 11:05:49 +01:00
parent 6b3b8c6f00
commit d7457fe9e0
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 6274d92c7da1977f7a6ba21ba490b9d1af7f34f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Tue, 27 Jan 2026 23:00:55 +0100
Subject: [PATCH] tests/test-runner: Do a client roundtrip after popup
'dismiss'
Popups in the test runner are tracked by finding the popup that belongs
to a certain parent. If one creates a popup immediately after dismissing
another popup on the same parent, there is a chance that the new
`popup_at` will find the old popup that is about to be dismissed, which
will fail the test with an error message about the window being
destroyed while waiting to be shown.
Avoid this by doing a roundtrip to the client after dismissing a popup,
effectively ensuring the popup is gone from window tracking before
processing the next command.
This aims to fix a flaky `popup-positions` test.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4867>
(cherry picked from commit 4ea89f1e3a586cd6b4d00290f6d071e59c2fc74a)
---
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 e036b16bd6..412592e608 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -3056,6 +3056,9 @@ test_case_do (TestCase *test,
return FALSE;
g_hash_table_remove (test->popups, argv[1]);
+
+ if (!test_case_wait (test, error))
+ return FALSE;
}
else
{
--
2.51.0

View File

@ -42,8 +42,9 @@ Patch: 0001-Revert-mdk-Use-PipeWire-damage-region-for-minimizing.patch
# available in the appropriate repository.
Patch: 0001-Revert-tests-monitor-backlight-Add-tests-for-the-sys.patch
# Fix flaky test
# Fix flaky tests
Patch: 0001-mtk-Take-explicit-reference-for-mtk_extrapolate_next.patch
Patch: 0001-tests-test-runner-Do-a-client-roundtrip-after-popup-.patch
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm)