From d7457fe9e05d2064310e520b8c7e4f461030f1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 17 Feb 2026 11:05:49 +0100 Subject: [PATCH] Fix flaky popup test Related: RHEL-144942 --- ...r-Do-a-client-roundtrip-after-popup-.patch | 42 +++++++++++++++++++ mutter.spec | 3 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0001-tests-test-runner-Do-a-client-roundtrip-after-popup-.patch diff --git a/0001-tests-test-runner-Do-a-client-roundtrip-after-popup-.patch b/0001-tests-test-runner-Do-a-client-roundtrip-after-popup-.patch new file mode 100644 index 0000000..86aa8a3 --- /dev/null +++ b/0001-tests-test-runner-Do-a-client-roundtrip-after-popup-.patch @@ -0,0 +1,42 @@ +From 6274d92c7da1977f7a6ba21ba490b9d1af7f34f1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +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: +(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 + diff --git a/mutter.spec b/mutter.spec index 6f422c0..d4aa77a 100644 --- a/mutter.spec +++ b/mutter.spec @@ -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)