summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-03-10 11:47:12 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2020-04-05 16:31:51 +0000
commit4ee7adf59d13ada5bfaa4f0382e0bb70b66b8814 (patch)
treec5eec25fc15ada89b1997636a7d6b9eb11c5541a /tests/auto
parent8ed14a3c481c3fc59f10cd084ea203cb45e89309 (diff)
Try to stabilize flaky test cases of tst_qsequentialanimationgroup
Use QTRY_COMPARE in the flaky tests instead of waiting. Change-Id: Ic18fc5fde3fa47f3b3ef21e6acd876bd6990981d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 0ae6803d3956cf59801bbcc52143b95de9fc96d1)
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
index 06e9fe7a66..d6607dc813 100644
--- a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
@@ -1295,10 +1295,9 @@ void tst_QSequentialAnimationGroup::startGroupWithRunningChild()
QCOMPARE(anim1->state(), QAnimationGroup::Running);
QCOMPARE(anim2->state(), QAnimationGroup::Paused);
- QTest::qWait(300);
-
+ // Wait until anim1 finishes (anim2 should be still running)
+ QTRY_COMPARE(anim1->state(), QAnimationGroup::Stopped);
QCOMPARE(group.state(), QAnimationGroup::Running);
- QCOMPARE(anim1->state(), QAnimationGroup::Stopped);
QCOMPARE(anim2->state(), QAnimationGroup::Running);
QCOMPARE(stateChangedSpy2.count(), 4);
@@ -1615,7 +1614,7 @@ void tst_QSequentialAnimationGroup::clear()
group.start();
QTest::qWait(anim1->duration() + 100);
QTRY_COMPARE(group.state(), QAbstractAnimation::Running);
- QVERIFY(anim1 == 0); //anim1 should have been deleted
+ QTRY_COMPARE(anim1, nullptr); // anim1 should have been deleted
}
void tst_QSequentialAnimationGroup::pauseResume()