UbuntuTestCase's flick() function is unreliable, does not always flick a Flickable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Fix Released
|
High
|
Zoltan Balogh | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
High
|
Andrea Bernabei |
Bug Description
revision 1864
System setup: Vivid + Overlay PPA (i.e. same as phones/tablets)
libqt5qml5:
Installed: 5.4.1-1ubuntu11
libqt5core5a:
Installed: 5.4.1+dfsg-
UbuntuTestCase provides a flick() function whose main purpose is to produce a flick event when executed on Flickable.
I noticed that this does not always happen, causing flakiness of some of the UITK tests (in my case, it's the Scrollbar/
Here is a test case that reproduces the issue, once every 10-200 runs, depending on the configuration (I use a simple script to run it until it fails)
Please note that uncommenting the debug lines such as onMovingChanged onFlickingChanged will make it harder to reproduce the bug.
Enabling QT_LOGGING_
Since I already went through the effort, I'm posting here the debug log coming from the failed and successful runs:
- Typical failed run ---> http://
- Typical successful run ---> http://
- Failed test with qt.quick.
- Successful test with qt.quick.
Here's the code I used to reproduce the bug:
import QtQuick 2.4
import QtTest 1.0
import Ubuntu.Test 1.0
import Ubuntu.Components 1.3
import Ubuntu.
import QtQml.Models 2.1
Item {
id: main
width: units.gu(50)
height: units.gu(100)
SignalSpy {
id: signalSpy
}
SignalSpy {
id: anotherSignalSpy
}
Item {
Item {
width: units.gu(20)
height: units.gu(30)
id: freshFlickable
}
}
}
}
UbuntuTestCase {
name: "FlickBug"
when: windowShown
function setupSignalSpy(spy, target, signalName) {
//reset signalName otherwise it will look for the old signalName in the new target
}
function test_flickUbunt
}
}
}
Related branches
- ubuntu-sdk-build-bot: Approve (continuous-integration)
- Cris Dywan: Approve
-
Diff: 18 lines (+4/-2)1 file modifiedsrc/Ubuntu/Test/UbuntuTestCase.qml (+4/-2)
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Andrea Bernabei (faenil) |
status: | In Progress → Fix Committed |
no longer affects: | canonical-devices-system-image |
Changed in canonical-devices-system-image: | |
status: | New → Fix Committed |
importance: | Undecided → High |
assignee: | nobody → Zoltan Balogh (bzoltan) |
milestone: | none → ww08-2016 |
Changed in canonical-devices-system-image: | |
status: | Fix Committed → Fix Released |
I investigated the issue by recompiling the QtQuick module and adding some debug info in qquickflickable.cpp
I added some debug in void QQuickFlickable Private: :handleMouseMov eEvent( QMouseEvent *event)
(I only added qDebug, the extra lines are to show the context)
if ((hMoved && !prevHMoved) || (vMoved && !prevVMoved))
q->movementSta rting() ;
qint64 currentTimestamp = computeCurrentT ime(event) ; mestamp - (lastPos.isNull() ? lastPressTime : lastPosTime)) / 1000.; :number( elapsed) % " currentTimestamp " % QString: :number( currentTimestam p) :number( lastPos. isNull( )) % " lastPressTime " % QString: :number( lastPressTime) :number( lastPosTime) % " vertical velocity " % QString: :number( vData.velocity) :number( hData.velocity) );
qreal elapsed = qreal(currentTi
qDebug() << QString("Elapsed " % QString:
% " lastPos.isNull " % QString:
% " lastPosTime " % QString:
% " horizontal velocity " % QString:
if (elapsed <= 0)
return;
And I added some debug in the handleMouseRele aseEvent as well
qDebug() << QString("Mouse release! Elapsed " % QString: :number( elapsed) % " vertical velocity " % QString: :number( vData.velocity) :number( hData.velocity) ); nPrivate: :mouseEventCaps (event) & QTouchDevice: :Velocity) Private: :mouseEventVelo city(event) .y() : vData.velocity;
% " horizontal velocity " % QString:
qreal vVelocity = 0;
if (elapsed < 100 && vData.velocity != 0.) {
vVelocity = (QGuiApplicatio
? QGuiApplication
}
The resulting log is at http:// pastebin. ubuntu. com/15196346/