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 <davidedmundson@kde.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-06-24 09:25:15 +02:00
parent 0b1d950e43
commit dba3e364c9

View File

@ -150,6 +150,9 @@ void tst_surface::negotiateShmFormat()
void tst_surface::createSubsurface() void tst_surface::createSubsurface()
{ {
m_config.autoFrameCallback = true;
auto autoFrameCallback = qScopeGuard([&] { m_config.autoFrameCallback = false; });
QRasterWindow window; QRasterWindow window;
window.setObjectName("main"); window.setObjectName("main");
window.resize(200, 200); window.resize(200, 200);