[
https://issues.apache.org/jira/browse/CB-10782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15207060#comment-15207060
]
ASF GitHub Bot commented on CB-10782:
-------------------------------------
Github user dblotsky commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-file-transfer/pull/132#discussion_r57049010
--- Diff: tests/tests.js ---
@@ -451,11 +451,25 @@ exports.defineAutoTests = function () {
it("filetransfer.spec.9 should not leave partial file due
to abort", function (done) {
+ jasmine.addMatchers({
+ toBeAbortOrConnectionError: function() {
+ return {
+ compare: function(transferError) {
+ var result = {pass: transferError ===
FileTransferError.ABORT_ERR || transferError ===
FileTransferError.CONNECTION_ERR};
+ if(!result.pass) {
+ result.message = "Expected " +
transferError + " to be " + FileTransferError.ABORT_ERR + " or " +
FileTransferError.CONNECTION_ERR;
+ }
+ return result;
+ }
+ }
+ }
+ });
--- End diff --
What I mean is: can't you just do this logic in the test and not have to
have a matcher?
> Occasional failure in file transfer tests causing mobilespec crash
> ------------------------------------------------------------------
>
> Key: CB-10782
> URL: https://issues.apache.org/jira/browse/CB-10782
> Project: Apache Cordova
> Issue Type: Test
> Components: Plugin File Transfer
> Reporter: Richard B Knoll
> Assignee: Sarangan Rajamanickam
> Labels: found-by-ci, windows
>
> {noformat}
> Dumping logs starting from 1620000
> Running command:
> wevtutil qe Microsoft-Windows-AppHost/ApplicationTracing /q:"*[System
> [TimeCreated[timediff(@SystemTime)<=1620000]]]" /e:root
> Running command:
> wevtutil qe Microsoft-Windows-AppHost/Admin /q:"*[System
> [TimeCreated[timediff(@SystemTime)<=1620000]]]" /e:root
> Channel: Microsoft-Windows-AppHost/Admin
> Time Created: 2016-03-03T13:34:20.496347300Z
> Process ID: 19324
> Document File: /www/cdvtests/index.html
> Display Name: mobilespec
> Error Description: {"exception":{"description":"Expected a spy, but got
> Function.","stack":"Error: Expected a spy, but got Function.\n at compare
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:2708:11)\n
> at Anonymous function
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:1358:7)\n
> at uploadFail
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer-tests/tests.js:1089:25)\n
> at errorCallback
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js:152:9)\n
> at cordova.callbackFromNative
> (ms-appx://org.apache.mobilespec/www/cordova.js:295:38)\n at
> cordova.callbackError
> (ms-appx://org.apache.mobilespec/www/cordova.js:282:9)\n at onError
> (ms-appx://org.apache.mobilespec/www/cordova.js:895:17)\n at Anonymous
> function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:134:17)\n
> at CompletePromise_then
> (ms-appx://microsoft.winjs.2.0/js/base.js:1950:21)\n at Anonymous function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:133:13)"},"error":null,"promise":{"_value":{"description":"Expected
> a spy, but got Function.","stack":"Error: Expected a spy, but got
> Function.\n at compare
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:2708:11)\n
> at Anonymous function
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:1358:7)\n
> at uploadFail
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer-tests/tests.js:1089:25)\n
> at errorCallback
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js:152:9)\n
> at cordova.callbackFromNative
> (ms-appx://org.apache.mobilespec/www/cordova.js:295:38)\n at
> cordova.callbackError
> (ms-appx://org.apache.mobilespec/www/cordova.js:282:9)\n at onError
> (ms-appx://org.apache.mobilespec/www/cordova.js:895:17)\n at Anonymous
> function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:134:17)\n
> at CompletePromise_then
> (ms-appx://microsoft.winjs.2.0/js/base.js:1950:21)\n at Anonymous function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:133:13)"},"_isException":true,"_errorId":2},"id":2}
> Stack Trace: Error: Expected a spy, but got Function.
> at compare
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:2708:11)
> at Anonymous function
> (ms-appx://org.apache.mobilespec/www/cdvtests/jasmine-2.2.0/jasmine.js:1358:7)
> at uploadFail
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer-tests/tests.js:1089:25)
> at errorCallback
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js:152:9)
> at cordova.callbackFromNative
> (ms-appx://org.apache.mobilespec/www/cordova.js:295:38)
> at cordova.callbackError
> (ms-appx://org.apache.mobilespec/www/cordova.js:282:9)
> at onError
> (ms-appx://org.apache.mobilespec/www/cordova.js:895:17)
> at Anonymous function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:134:17)
> at CompletePromise_then
> (ms-appx://microsoft.winjs.2.0/js/base.js:1950:21)
> at Anonymous function
> (ms-appx://org.apache.mobilespec/www/plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js:133:13)
> {noformat}
> Started showing up in the Windows Store 8.1 CI yesterday, but only happens
> intermittently.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]