Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11188

cordova-plugin-device-motion-tests are failing in CI

Details

    Description

      Error happening in multiple platforms. Sample Link: https://ci.apache.org/builders/cordova-android-win/builds/2276/steps/getting-test-results/logs/stdio

      Sample Error
      ===========
      Total failures: 1
      Failing tests:
      cordova-plugin-device-motion-tests.tests >> Accelerometer (navigator.accelerometer) watchAcceleration accelerometer.spec.9 success callback Acceleration object should return a recent timestamp
      Expected 1462208916338 to be greater than 1462208916528.
      Error: Expected 1462208916338 to be greater than 1462208916528.
      at stack (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:1455:17)
      at buildExpectationResult (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:1425:14)
      at Spec.Env.expectationResultFactory (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:572:18)
      at Spec.addExpectationResult (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:321:34)
      at Expectation.addExpectationResult (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:516:21)
      at Expectation.toBeGreaterThan (file:///android_asset/www/cdvtests/jasmine-2.2.0/jasmine.js:1379:12)
      at win (file:///android_asset/www/plugins/cordova-plugin-device-motion-tests/tests.js:186:33)
      at file:///android_asset/www/plugins/cordova-plugin-device-motion/www/accelerometer.js:156:21

      Attachments

        Issue Links

          Activity

            githubbot ASF GitHub Bot added a comment -

            GitHub user sarangan12 opened a pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43

            CB-11188: cordova-plugin-device-motion-tests are failing in CI

            The error is happening in an assert statement where it tries to compare two timestamp values. This kind of comparison is risky as there might be slight variations. For eg:

            1. Expected 1462451458702 to be greater than 1462451458723
            2. Expected 1462470496780 to be greater than 1462470496875

            In the above examples, you can see the actual value is very close to the expected value. It is 99.9999 percent of the actual value. But, the test is failing due to the strict comparison. So, I have changed the assert to accept the actual value is above 95% of the expected value.

            @omefire Could you please review and merge this PR?

            You can merge this pull request into a Git repository by running:

            $ git pull https://github.com/sarangan12/cordova-plugin-device-motion CB-11188

            Alternatively you can review and apply these changes as the patch at:

            https://github.com/apache/cordova-plugin-device-motion/pull/43.patch

            To close this pull request, make a commit to your master/trunk branch
            with (at least) the following in the commit message:

            This closes #43


            commit 98a29cd2ac776d8717f4636f7c7aea09d52c8fe1
            Author: Sarangan Rajamanickam <sarajama@microsoft.com>
            Date: 2016-05-05T18:11:05Z

            CB-11188: cordova-plugin-device-motion-tests are failing in CI


            githubbot ASF GitHub Bot added a comment - GitHub user sarangan12 opened a pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43 CB-11188 : cordova-plugin-device-motion-tests are failing in CI The error is happening in an assert statement where it tries to compare two timestamp values. This kind of comparison is risky as there might be slight variations. For eg: 1. Expected 1462451458702 to be greater than 1462451458723 2. Expected 1462470496780 to be greater than 1462470496875 In the above examples, you can see the actual value is very close to the expected value. It is 99.9999 percent of the actual value. But, the test is failing due to the strict comparison. So, I have changed the assert to accept the actual value is above 95% of the expected value. @omefire Could you please review and merge this PR? You can merge this pull request into a Git repository by running: $ git pull https://github.com/sarangan12/cordova-plugin-device-motion CB-11188 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-device-motion/pull/43.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #43 commit 98a29cd2ac776d8717f4636f7c7aea09d52c8fe1 Author: Sarangan Rajamanickam <sarajama@microsoft.com> Date: 2016-05-05T18:11:05Z CB-11188 : cordova-plugin-device-motion-tests are failing in CI
            githubbot ASF GitHub Bot added a comment -

            Github user omefire commented on a diff in the pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43#discussion_r62233809

            — Diff: tests/tests.js —
            @@ -122,6 +122,7 @@ exports.defineAutoTests = function () {

            describe("watchAcceleration", function() {
            var id;
            + var ACCEPTABLE_PERCENT_RANGE = 95;
            — End diff –

            Plz, Move this variable to within spec.9 as it's the only test that currently uses it.

            githubbot ASF GitHub Bot added a comment - Github user omefire commented on a diff in the pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43#discussion_r62233809 — Diff: tests/tests.js — @@ -122,6 +122,7 @@ exports.defineAutoTests = function () { describe("watchAcceleration", function() { var id; + var ACCEPTABLE_PERCENT_RANGE = 95; — End diff – Plz, Move this variable to within spec.9 as it's the only test that currently uses it.
            githubbot ASF GitHub Bot added a comment -

            Github user omefire commented on the pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217238656

            +1 . Introducing a delta for this kind of comparisons is a good strategy for this issue.

            githubbot ASF GitHub Bot added a comment - Github user omefire commented on the pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217238656 +1 . Introducing a delta for this kind of comparisons is a good strategy for this issue.
            githubbot ASF GitHub Bot added a comment -

            Github user omefire commented on the pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217239510

            Other than the minor stuff mentioned, LGTM!

            githubbot ASF GitHub Bot added a comment - Github user omefire commented on the pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217239510 Other than the minor stuff mentioned, LGTM!
            githubbot ASF GitHub Bot added a comment -

            Github user sarangan12 commented on a diff in the pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43#discussion_r62237574

            — Diff: tests/tests.js —
            @@ -122,6 +122,7 @@ exports.defineAutoTests = function () {

            describe("watchAcceleration", function() {
            var id;
            + var ACCEPTABLE_PERCENT_RANGE = 95;
            — End diff –

            @omefire Done

            githubbot ASF GitHub Bot added a comment - Github user sarangan12 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43#discussion_r62237574 — Diff: tests/tests.js — @@ -122,6 +122,7 @@ exports.defineAutoTests = function () { describe("watchAcceleration", function() { var id; + var ACCEPTABLE_PERCENT_RANGE = 95; — End diff – @omefire Done
            githubbot ASF GitHub Bot added a comment -

            Github user omefire commented on the pull request:

            https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217259632

            a comment would also be great

            githubbot ASF GitHub Bot added a comment - Github user omefire commented on the pull request: https://github.com/apache/cordova-plugin-device-motion/pull/43#issuecomment-217259632 a comment would also be great

            Commit 7a6259db32c7d3cbfc9f78d193bba07fdcffc78a in cordova-plugin-device-motion's branch refs/heads/master from sarangan12
            [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-device-motion.git;h=7a6259d ]

            CB-11188: cordova-plugin-device-motion-tests are failing in CI

            This closes #43

            jira-bot ASF subversion and git services added a comment - Commit 7a6259db32c7d3cbfc9f78d193bba07fdcffc78a in cordova-plugin-device-motion's branch refs/heads/master from sarangan12 [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-device-motion.git;h=7a6259d ] CB-11188 : cordova-plugin-device-motion-tests are failing in CI This closes #43
            githubbot ASF GitHub Bot added a comment -

            Github user asfgit closed the pull request at:

            https://github.com/apache/cordova-plugin-device-motion/pull/43

            githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-device-motion/pull/43

            Commit 7a6259db32c7d3cbfc9f78d193bba07fdcffc78a in cordova-plugin-device-motion's branch refs/heads/1.2.x from sarangan12
            [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-device-motion.git;h=7a6259d ]

            CB-11188: cordova-plugin-device-motion-tests are failing in CI

            This closes #43

            jira-bot ASF subversion and git services added a comment - Commit 7a6259db32c7d3cbfc9f78d193bba07fdcffc78a in cordova-plugin-device-motion's branch refs/heads/1.2.x from sarangan12 [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-device-motion.git;h=7a6259d ] CB-11188 : cordova-plugin-device-motion-tests are failing in CI This closes #43

            People

              sarangan12 Sarangan Rajamanickam
              sarangan12 Sarangan Rajamanickam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: