Merge lp:~cimi/unity8/fix-lazyImage-test-flakyness into lp:unity8

Proposed by Andrea Cimitan
Status: Superseded
Proposed branch: lp:~cimi/unity8/fix-lazyImage-test-flakyness
Merge into: lp:unity8
Diff against target: 71 lines (+23/-6)
2 files modified
qml/Components/LazyImage.qml (+3/-0)
tests/qmltests/Components/tst_LazyImage.qml (+20/-6)
To merge this branch: bzr merge lp:~cimi/unity8/fix-lazyImage-test-flakyness
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Michael Zanetti (community) Needs Information
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+277459@code.launchpad.net

This proposal has been superseded by a proposal from 2016-01-28.

Commit message

Should fix lazyimage test failures on fast machines

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
n
 * Did you perform an exploratory manual test run of your code change and any related functionality?
y
 * Did you make sure that your branch does not contain spurious tags?
y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
n/a

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Not sure this is the correct fix, as far as i see it the problem is that the state of the LazyImage when changing goes

qml: STATE default
qml: STATE ready
qml: STATE loading
qml: STATE ready

The first ready seems to be wrong to me.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2040
http://jenkins.qa.ubuntu.com/job/unity8-ci/6708/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5149/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/123/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1420/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/123
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1315
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1316
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5163
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5163/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/24/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/123
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/123/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25134

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6708/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2040
http://jenkins.qa.ubuntu.com/job/unity8-ci/6719/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5200/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/134/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1431
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1326
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1327
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/133
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/133
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4131/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5217
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5217/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25174
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/26/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/134
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/134/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25173

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6719/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2040
http://jenkins.qa.ubuntu.com/job/unity8-ci/6723/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5217
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/138/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1436
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/138
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1330
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1331
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/137
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/137
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5234
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5234/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25193
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/29/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/138
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/138/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25195

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6723/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

that signal seems to be just used for testing. If so, can't we use "findInvisibleChild()" to find the animation and use tryCompare() on the running property instead?

review: Needs Information
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2040
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/31/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/31/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

ok, had been looking at this and besides the fact that I cant repro the flakiness at all, it seems to me that the code actually properly does wait for the transition already.

If there's still some flakiness it's probably because of the render thread lagging a bit behind and I think a simple "waitForRendering(data.image)" should be enough to get this sorted.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/LazyImage.qml'
2--- qml/Components/LazyImage.qml 2015-11-04 14:57:13 +0000
3+++ qml/Components/LazyImage.qml 2015-11-13 16:01:53 +0000
4@@ -40,6 +40,8 @@
5
6 state: "default"
7
8+ signal readyTransitionRunning(bool running)
9+
10 onSourceChanged: {
11 if (state === "ready") {
12 state = "default";
13@@ -157,6 +159,7 @@
14 Transition {
15 to: "ready"
16 objectName: "readyTransition"
17+ onRunningChanged: root.readyTransitionRunning(running)
18 SequentialAnimation {
19 PropertyAction { target: shape; property: "visible" }
20 ParallelAnimation {
21
22=== modified file 'tests/qmltests/Components/tst_LazyImage.qml'
23--- tests/qmltests/Components/tst_LazyImage.qml 2015-07-15 15:07:19 +0000
24+++ tests/qmltests/Components/tst_LazyImage.qml 2015-11-13 16:01:53 +0000
25@@ -112,6 +112,11 @@
26 }
27 }
28
29+ SignalSpy {
30+ id: signalSpy
31+ signalName: "readyTransitionRunning"
32+ }
33+
34 UT.UnityTestCase {
35 name: "LazyImage"
36 when: windowShown
37@@ -144,8 +149,8 @@
38 {tag: "Height-bound Bad path", image: lazy3, func: controls3.badpath, transition: "genericTransition", width: units.gu(10), height: units.gu(12), imageWidth: units.gu(10), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12), placeholder: true, error: true},
39 {tag: "Fit Blank", image: lazy4, func: controls4.blank, width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true},
40 {tag: "Fit Wide", image: lazy4, func: controls4.wide, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(6), initialWidth: units.gu(12), initialHeight: units.gu(12)},
41- {tag: "Fit Square", image: lazy4, func: controls4.square, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
42- {tag: "Fit Portrait", image: lazy4, func: controls4.portrait, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
43+ {tag: "Fit Square", image: lazy4, func: controls4.square, transition: "readyTransition", transitionCount: 4, width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
44+ {tag: "Fit Portrait", image: lazy4, func: controls4.portrait, transition: "readyTransition", transitionCount: 4, width: units.gu(12), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
45 {tag: "Fit Bad path", image: lazy4, func: controls4.badpath, transition: "genericTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true, error: true},
46 ]
47 }
48@@ -154,10 +159,19 @@
49 data.func();
50
51 if (data.transition) {
52- // wait for the transition to complete
53- var transition = findChildIn(data.image, "transitions", data.transition);
54- tryCompare(transition, "running", true);
55- tryCompare(transition, "running", false);
56+ if (data.transition == "readyTransition") {
57+ signalSpy.target = data.image;
58+ signalSpy.clear();
59+ tryCompare(signalSpy, "count", data.transitionCount ? data.transitionCount : 2);
60+ for (var i = 0; i < signalSpy.count; i++) {
61+ compare(signalSpy.signalArguments[i][0], i % 2 == 0 ? true : false);
62+ }
63+ } else {
64+ // wait for the transition to complete
65+ var transition = findChildIn(data.image, "transitions", data.transition);
66+ tryCompare(transition, "running", true);
67+ tryCompare(transition, "running", false);
68+ }
69 }
70
71 // check the dimensions

Subscribers

People subscribed via source and target branches