Details
-
Test
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
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
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 CIThe 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-11188Alternatively 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