File: fix_flakiness_in_tst_surface_createSubsurface.diff

package info (click to toggle)
qtwayland-opensource-src 5.15.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,176 kB
  • sloc: cpp: 53,704; xml: 9,462; ansic: 187; makefile: 29; sh: 5
file content (28 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: 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.
Origin: upstream, https://code.qt.io/cgit/qt/qtwayland.git/commit/?id=1cb07aa7ec97b3ad
Last-Update: 2025-09-03

--- a/tests/auto/client/surface/tst_surface.cpp
+++ b/tests/auto/client/surface/tst_surface.cpp
@@ -177,6 +177,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);