Details
-
Bug
-
Resolution: Done
-
P4: Low
-
Some future release
-
a2c7428e4d (qt/qtbase/dev) a2c7428e4d (qt/tqtc-qtbase/dev) 17667ce074 (qt/qtbase/6.3) 17667ce074 (qt/tqtc-qtbase/6.3) ca7a2f84de (qt/qtbase/6.4) ca7a2f84de (qt/tqtc-qtbase/6.4) 04b8fb4d71 (qt/tqtc-qtbase/6.2) 7524a36a26 (qt/qtbase/dev)
Description
I keep seeing this FAIL on my OpenSUSE Tumbleweed system 9 out of 10 times. I see it failing on OpenSUSE on the CI too.
$ TESTARGS=initialShow ctest -V -R tst_qgraphicswidget 498: ********* Start testing of tst_QGraphicsWidget ********* 498: Config: Using QtTest library 6.3.0, Qt 6.3.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9]), opensuse-tumbleweed 20211127 498: PASS : tst_QGraphicsWidget::initTestCase() 498: FAIL! : tst_QGraphicsWidget::initialShow() 'QTest::qWaitForWindowActive(dummyView.data())' returned FALSE. () 498: Loc: [/home/qtjimis/dist/src/qt/qtbase/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp(3129)] 498: PASS : tst_QGraphicsWidget::cleanupTestCase() 498: Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 5062ms 498: ********* Finished testing of tst_QGraphicsWidget *********
It always pauses for 5 seconds on the QVERIFY(QTest::qWaitForWindowActive() and then returns failure. The funny thing is that if I remove the 2 qWaitForWindowActive() calls, the test always passes!
Here is the test (The "REMOVE THIS" annotations are mine and show how the test can be stabilised):
void tst_QGraphicsWidget::initialShow() { class MyGraphicsWidget : public QGraphicsWidget { public: MyGraphicsWidget() : repaints(0) {} int repaints; void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget*) override { ++repaints; } void polishEvent() override { update(); } }; // Don't let paint events triggered by the windowing system // influence our test case. We're only interested in knowing // whether a QGraphicsWidget generates an additional repaint // on the initial show. Hence create a dummy scenario to find out // how many repaints we should expect. QGraphicsScene dummyScene(0, 0, 200, 200); dummyScene.addItem(new QGraphicsRectItem(0, 0, 100, 100)); QScopedPointer<QGraphicsView> dummyView(new QGraphicsView(&dummyScene)); dummyView->setWindowFlags(Qt::X11BypassWindowManagerHint); EventSpy paintSpy(dummyView->viewport(), QEvent::Paint); dummyView->show(); qApp->setActiveWindow(dummyView.data()); QVERIFY(QTest::qWaitForWindowActive(dummyView.data())); // REMOVE THIS! const int expectedRepaintCount = paintSpy.count(); dummyView.reset(); MyGraphicsWidget *widget = new MyGraphicsWidget; widget->resize(100, 100); QGraphicsScene scene(0, 0, 200, 200); scene.addItem(widget); QGraphicsView view(&scene); view.setWindowFlags(view.windowFlags()|Qt::X11BypassWindowManagerHint); view.show(); qApp->setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); // REMOVE THIS TOO! QTRY_COMPARE(widget->repaints, expectedRepaintCount); }
Attachments
Issue Links
- resulted in
-
QTBUG-98923 BLACKLIST entry "opensuse" does not match "opensuse-tumbleweed" or "opensuse-leap"
- Reported
For Gerrit Dashboard: QTBUG-98921 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
384693,5 | Blacklist flaky tst_qgraphicswidget:initialShow on OpenSUSE | dev | qt/qtbase | Status: MERGED | +2 | 0 |
421782,2 | QGraphicsWidget: skip test if graphics view fails to show | dev | qt/qtbase | Status: MERGED | +2 | 0 |
421877,2 | QGraphicsWidget: skip test if graphics view fails to show | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
421878,2 | QGraphicsWidget: skip test if graphics view fails to show | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
421884,2 | QGraphicsWidget: skip test if graphics view fails to show | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
424889,6 | Stabilize test by not activating window | dev | qt/qtbase | Status: MERGED | +2 | 0 |