← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1549256] [NEW] UbuntuTestCase's flick() function is unreliable, does not always flick a Flickable

 

Public bug reported:

revision 1864

System setup: Vivid + Overlay PPA (i.e. same as phones/tablets)

libqt5qml5:
  Installed: 5.4.1-1ubuntu11~overlay3
libqt5core5a:
  Installed: 5.4.1+dfsg-2ubuntu11~vivid4

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/ScrollView tests I'm
working on)

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_RULES="qt.quick.mouse.debug=true" or
onContentYChanged will make it even harder. I could not manager to
reproduce it with both enabled.

Since I already went through the effort, I'm posting here the debug log coming from the failed and successful runs (all debug enabled except qt.quick.mouse.debug:
- Typical failed run ---> http://pastebin.ubuntu.com/15186789/ Note how "flicking" never becomes true
- Typical successful run ---> http://pastebin.ubuntu.com/15186784/

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.Components.Styles 1.3
import QtQml.Models 2.1

Item {
    id: main
    width: units.gu(50)
    height: units.gu(100)

    SignalSpy {
        id: signalSpy
    }
    SignalSpy {
        id: anotherSignalSpy
    }

    Item {
        anchors.fill: parent
        Item {
            width: units.gu(20)
            height: units.gu(30)
            property alias flickable: freshFlickable
            Flickable {
                id: freshFlickable
                anchors.fill: parent
                contentHeight: content.height
                contentWidth: content.width
                clip: true
                //onContentYChanged: console.log(contentY)
                //onMovingChanged: console.log("MOVING", moving)
                //onFlickingChanged: console.log("FLICKING", flicking)
                Rectangle {
                    id: content
                    width: units.gu(40)
                    height: units.gu(200)
                    color: "blue"
                }
            }
        }
    }

    UbuntuTestCase {
        name: "FlickBug"
        when: windowShown

        function setupSignalSpy(spy, target, signalName) {
            spy.clear()
            spy.signalName = ""
            spy.target = target
            spy.signalName = signalName
        }

        function test_flickUbuntuTestCase() {
            setupSignalSpy(signalSpy, freshFlickable, "movingChanged")
            flick(freshFlickable, 50, 50, -units.gu(10), -units.gu(10))
            signalSpy.wait()
            compare(signalSpy.count, 1, "Wrong number of movingChanged signals.")
        }
    }
}

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  revision 1864
  
  System setup: Vivid + Overlay PPA (i.e. same as phones/tablets)
  
  libqt5qml5:
-   Installed: 5.4.1-1ubuntu11~overlay3
+   Installed: 5.4.1-1ubuntu11~overlay3
  libqt5core5a:
-   Installed: 5.4.1+dfsg-2ubuntu11~vivid4
+   Installed: 5.4.1+dfsg-2ubuntu11~vivid4
  
  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/ScrollView tests I'm
  working on)
  
  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_RULES="qt.quick.mouse.debug=true" or
  onContentYChanged will make it even harder.
  
  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://pastebin.ubuntu.com/15186789/ Note how "flicking" never becomes true
  - Typical successful run ---> http://pastebin.ubuntu.com/15186784/
  
  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.Components.Styles 1.3
  import QtQml.Models 2.1
  
  Item {
-     id: main
-     width: units.gu(50)
-     height: units.gu(100)
+     id: main
+     width: units.gu(50)
+     height: units.gu(100)
  
-     SignalSpy {
-         id: signalSpy
-     }
-     SignalSpy {
-         id: anotherSignalSpy
-     }
+     SignalSpy {
+         id: signalSpy
+     }
+     SignalSpy {
+         id: anotherSignalSpy
+     }
  
-     Item {
-         anchors.fill: parent
-         Item {
-             width: units.gu(20)
-             height: units.gu(30)
-             property alias flickable: freshFlickable
-             Flickable {
-                 id: freshFlickable
-                 anchors.fill: parent
-                 contentHeight: content.height
-                 contentWidth: content.width
-                 clip: true
-                 //onContentYChanged: console.log(contentY)
-                 //onMovingChanged: console.log("MOVING", moving)
-                 //onFlickingChanged: console.log("FLICKING", flicking)
-                 Rectangle {
-                     id: content
-                     width: units.gu(40)
-                     height: units.gu(200)
-                     color: "blue"
-                 }
-             }
-         }
-     }
+     Item {
+         anchors.fill: parent
+         Item {
+             width: units.gu(20)
+             height: units.gu(30)
+             property alias flickable: freshFlickable
+             Flickable {
+                 id: freshFlickable
+                 anchors.fill: parent
+                 contentHeight: content.height
+                 contentWidth: content.width
+                 clip: true
+                 //onContentYChanged: console.log(contentY)
+                 //onMovingChanged: console.log("MOVING", moving)
+                 //onFlickingChanged: console.log("FLICKING", flicking)
+                 Rectangle {
+                     id: content
+                     width: units.gu(40)
+                     height: units.gu(200)
+                     color: "blue"
+                 }
+             }
+         }
+     }
  
-     UbuntuTestCase {
-         name: "FlickBug"
-         when: windowShown
+     UbuntuTestCase {
+         name: "FlickBug"
+         when: windowShown
  
-         function setupSignalSpy(spy, target, signalName) {
-             spy.clear()
-             //reset signalName otherwise it will look for the old signalName in the new target
-             spy.signalName = ""
-             spy.target = target
-             spy.signalName = signalName
-         }
+         function setupSignalSpy(spy, target, signalName) {
+             spy.clear()
+             spy.signalName = ""
+             spy.target = target
+             spy.signalName = signalName
+         }
  
-         function test_flickUbuntuTestCase() {
-             setupSignalSpy(signalSpy, freshFlickable, "movingChanged")
-             flick(freshFlickable, 50, 50, -units.gu(10), -units.gu(10))
-             signalSpy.wait()
-             compare(signalSpy.count, 1, "No movingChanged signal after simulating a flick.")
-         }
-     }
+         function test_flickUbuntuTestCase() {
+             setupSignalSpy(signalSpy, freshFlickable, "movingChanged")
+             flick(freshFlickable, 50, 50, -units.gu(10), -units.gu(10))
+             signalSpy.wait()
+             compare(signalSpy.count, 1, "Wrong number of movingChanged signals.")
+         }
+     }
  }

** Description changed:

  revision 1864
  
  System setup: Vivid + Overlay PPA (i.e. same as phones/tablets)
  
  libqt5qml5:
    Installed: 5.4.1-1ubuntu11~overlay3
  libqt5core5a:
    Installed: 5.4.1+dfsg-2ubuntu11~vivid4
  
  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/ScrollView tests I'm
  working on)
  
  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_RULES="qt.quick.mouse.debug=true" or
- onContentYChanged will make it even harder.
+ onContentYChanged will make it even harder. I could not manager to
+ reproduce it with both enabled.
  
- Since I already went through the effort, I'm posting here the debug log coming from the failed and successful runs:
+ Since I already went through the effort, I'm posting here the debug log coming from the failed and successful runs (all debug enabled except qt.quick.mouse.debug:
  - Typical failed run ---> http://pastebin.ubuntu.com/15186789/ Note how "flicking" never becomes true
  - Typical successful run ---> http://pastebin.ubuntu.com/15186784/
  
  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.Components.Styles 1.3
  import QtQml.Models 2.1
  
  Item {
      id: main
      width: units.gu(50)
      height: units.gu(100)
  
      SignalSpy {
          id: signalSpy
      }
      SignalSpy {
          id: anotherSignalSpy
      }
  
      Item {
          anchors.fill: parent
          Item {
              width: units.gu(20)
              height: units.gu(30)
              property alias flickable: freshFlickable
              Flickable {
                  id: freshFlickable
                  anchors.fill: parent
                  contentHeight: content.height
                  contentWidth: content.width
                  clip: true
                  //onContentYChanged: console.log(contentY)
                  //onMovingChanged: console.log("MOVING", moving)
                  //onFlickingChanged: console.log("FLICKING", flicking)
                  Rectangle {
                      id: content
                      width: units.gu(40)
                      height: units.gu(200)
                      color: "blue"
                  }
              }
          }
      }
  
      UbuntuTestCase {
          name: "FlickBug"
          when: windowShown
  
          function setupSignalSpy(spy, target, signalName) {
              spy.clear()
              spy.signalName = ""
              spy.target = target
              spy.signalName = signalName
          }
  
          function test_flickUbuntuTestCase() {
              setupSignalSpy(signalSpy, freshFlickable, "movingChanged")
              flick(freshFlickable, 50, 50, -units.gu(10), -units.gu(10))
              signalSpy.wait()
              compare(signalSpy.count, 1, "Wrong number of movingChanged signals.")
          }
      }
  }

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1549256

Title:
  UbuntuTestCase's flick() function is unreliable, does not always flick
  a Flickable

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  revision 1864

  System setup: Vivid + Overlay PPA (i.e. same as phones/tablets)

  libqt5qml5:
    Installed: 5.4.1-1ubuntu11~overlay3
  libqt5core5a:
    Installed: 5.4.1+dfsg-2ubuntu11~vivid4

  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/ScrollView tests I'm
  working on)

  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_RULES="qt.quick.mouse.debug=true" or
  onContentYChanged will make it even harder. I could not manager to
  reproduce it with both enabled.

  Since I already went through the effort, I'm posting here the debug log coming from the failed and successful runs (all debug enabled except qt.quick.mouse.debug:
  - Typical failed run ---> http://pastebin.ubuntu.com/15186789/ Note how "flicking" never becomes true
  - Typical successful run ---> http://pastebin.ubuntu.com/15186784/

  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.Components.Styles 1.3
  import QtQml.Models 2.1

  Item {
      id: main
      width: units.gu(50)
      height: units.gu(100)

      SignalSpy {
          id: signalSpy
      }
      SignalSpy {
          id: anotherSignalSpy
      }

      Item {
          anchors.fill: parent
          Item {
              width: units.gu(20)
              height: units.gu(30)
              property alias flickable: freshFlickable
              Flickable {
                  id: freshFlickable
                  anchors.fill: parent
                  contentHeight: content.height
                  contentWidth: content.width
                  clip: true
                  //onContentYChanged: console.log(contentY)
                  //onMovingChanged: console.log("MOVING", moving)
                  //onFlickingChanged: console.log("FLICKING", flicking)
                  Rectangle {
                      id: content
                      width: units.gu(40)
                      height: units.gu(200)
                      color: "blue"
                  }
              }
          }
      }

      UbuntuTestCase {
          name: "FlickBug"
          when: windowShown

          function setupSignalSpy(spy, target, signalName) {
              spy.clear()
              spy.signalName = ""
              spy.target = target
              spy.signalName = signalName
          }

          function test_flickUbuntuTestCase() {
              setupSignalSpy(signalSpy, freshFlickable, "movingChanged")
              flick(freshFlickable, 50, 50, -units.gu(10), -units.gu(10))
              signalSpy.wait()
              compare(signalSpy.count, 1, "Wrong number of movingChanged signals.")
          }
      }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1549256/+subscriptions


Follow ups