From dba3e364c98f0b2a9da19e9788e2dd4328614040 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 24 Jun 2024 09:25:15 +0200 Subject: [PATCH] Fix flakiness in tst_surface::createSubsurface() The tst_surface test has disabled automatic frame callbacks in the mock compositor. This means that if the timeout for this (100 ms) happens before the test finishes, all subsequent calls to isExposed() will fail, and commits will not be sent. The automatic frame callback was added for this specific reason, but for some reason it was disabled for tst_surface. This might just be conservative, but in case it could break some condition in the other tests, I have only enabled it for the specific test where it is clearly required. Task-number: QTBUG-126262 Change-Id: I91dbd6d837b5444c5e07659dc0b73fb28ece151d Reviewed-by: David Edmundson --- tests/auto/wayland/surface/tst_surface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/wayland/surface/tst_surface.cpp b/tests/auto/wayland/surface/tst_surface.cpp index 06e625155f2..9fe4188ef81 100644 --- a/tests/auto/wayland/surface/tst_surface.cpp +++ b/tests/auto/wayland/surface/tst_surface.cpp @@ -150,6 +150,9 @@ void tst_surface::negotiateShmFormat() void tst_surface::createSubsurface() { + m_config.autoFrameCallback = true; + auto autoFrameCallback = qScopeGuard([&] { m_config.autoFrameCallback = false; }); + QRasterWindow window; window.setObjectName("main"); window.resize(200, 200);