From 3761d99512244ae167a66e6894c75eb2ef1cca48 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Wed, 2 May 2018 11:24:31 +0300 Subject: [PATCH] tst_QTabWidget: Add unconditional qWait() back paintEventCount() is currently flaky on macOS. It gets extra paint events after qWaitForWindowExposed() returns, which causes the following assertions to fail. Add the wait that was removed in 0cb940b1d3b9a1ba50f2d1973fca411706da266d back to fix those failures. Task-number: QTBUG-68032 Change-Id: I68e0b6008de40922ec740291dfdd1842e0f62f89 Reviewed-by: Sami Nurmenniemi Reviewed-by: Richard Moe Gustavsen Reviewed-by: Ville Voutilainen --- tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp index cd7fe3710d6..cbf5196bb95 100644 --- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp +++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp @@ -549,7 +549,9 @@ void tst_QTabWidget::paintEventCount() QCOMPARE(tw->currentIndex(), 0); tw->show(); - QVERIFY(QTest::qWaitForWindowActive(tw)); + QVERIFY(QTest::qWaitForWindowExposed(tw)); + // Wait for extra paint events that happen at least on macOS + QTest::qWait(1000); // Mac, Windows and Windows CE get multiple repaints on the first show, so use those as a starting point. static const int MaxInitialPaintCount =