summaryrefslogtreecommitdiffstats
path: root/tests
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-03-12 14:16:53 +0000
commit2c6524167ed250aea056b084be11ddd89da5a7a6 (patch)
tree07bfced0c94e13e15d9467280c119252f1134869 /tests
parent85908c9c27f07ee500e161b4280d5def1ba30ef5 (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')
-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()