AutoTest: Fix flaky unit test

Since parsing and updating the tree model has been changed the
respective tests became flaky.

Change-Id: I82fcde51493bc86e2315018b21e9bacd8e8409a9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-02-10 10:43:31 +01:00
parent 25d63d8556
commit a4b747307e
4 changed files with 17 additions and 0 deletions

View File

@@ -96,7 +96,9 @@ void AutoTestUnitTests::testCodeParser()
QVERIFY(projectInfo.isValid());
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
QSignalSpy modelUpdateSpy(m_model, SIGNAL(sweepingDone()));
QVERIFY(parserSpy.wait(20000));
QVERIFY(modelUpdateSpy.wait());
if (m_isQt4)
expectedNamedQuickTestsCount = expectedUnnamedQuickTestsCount = 0;
@@ -148,7 +150,9 @@ void AutoTestUnitTests::testCodeParserSwitchStartup()
QVERIFY(projectInfo.isValid());
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
QSignalSpy modelUpdateSpy(m_model, SIGNAL(sweepingDone()));
QVERIFY(parserSpy.wait(20000));
QVERIFY(modelUpdateSpy.wait());
QCOMPARE(m_model->autoTestsCount(), expectedAutoTestsCount.at(i));
QCOMPARE(m_model->namedQuickTestsCount(),
@@ -198,7 +202,9 @@ void AutoTestUnitTests::testCodeParserGTest()
QVERIFY(projectInfo.isValid());
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
QSignalSpy modelUpdateSpy(m_model, SIGNAL(sweepingDone()));
QVERIFY(parserSpy.wait(20000));
QVERIFY(modelUpdateSpy.wait());
QCOMPARE(m_model->gtestNamesCount(), 6);