From a8cfbf6aa61c85bd082583388e5cfac84e0f4d3f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 17 Oct 2013 09:24:09 +0200 Subject: [PATCH] Fix flaky QQmlProfilerService::scenegraphData test QSGRenderThread::syncAndRender first triggers the frameSwapped() signal, and only then adds the SceneGraphRenderLoopFrame message. We're waiting for the frameSwapped signal to stop profiling, and therefore can't be sure whether we'll get the final SceneGraphRenderLoopFrame message or not. Task-number: QTBUG-33024 Change-Id: I3216667e8e5cdc79f210290ce22cc6b08c579b6a Reviewed-by: Lars Knoll --- .../debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index b9aefb3..902e525 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -459,22 +459,21 @@ void tst_QQmlProfilerService::scenegraphData() // check that at least one frame was rendered // there should be a SGPolishAndSync + SGRendererFrame + SGRenderLoopFrame sequence + // (though we can't be sure to get the SGRenderLoopFrame in the threaded renderer) + // // since the rendering happens in a different thread, there could be other unrelated events interleaved int loopcheck = 0; foreach (const QQmlProfilerData &msg, m_client->traceMessages) { if (msg.messageType == QQmlProfilerClient::SceneGraphFrame) { if (loopcheck == 0 && msg.detailType == QQmlProfilerClient::SceneGraphContextFrame) loopcheck = 1; - else - if (loopcheck == 1 && msg.detailType == QQmlProfilerClient::SceneGraphRendererFrame) + else if (loopcheck == 1 && msg.detailType == QQmlProfilerClient::SceneGraphRendererFrame) loopcheck = 2; - else - if (loopcheck == 2 && msg.detailType == QQmlProfilerClient::SceneGraphRenderLoopFrame) + else if (loopcheck == 2 && msg.detailType == QQmlProfilerClient::SceneGraphRenderLoopFrame) loopcheck = 3; } } - - QCOMPARE(loopcheck, 3); + QVERIFY(loopcheck >= 2); } void tst_QQmlProfilerService::profileOnExit() -- 2.7.4