You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by riknoll <gi...@git.apache.org> on 2016/02/09 23:08:57 UTC

[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

GitHub user riknoll opened a pull request:

    https://github.com/apache/cordova-medic/pull/76

    CB-10433: Removing the ETIMEDOUT errors in medic-run

    Occasionally, requests to couchdb fail for mysterious reasons when medic-run does its polling for mobilespec results. These were being reported a lot as the cause of CI issues, but in fact they are not. Only a few requests fail out of multiple poll attempts and sometimes these messages show up in successful runs. This removes the annoying ETIMEDOUT messages and replaces them with brief stats at the end of the polling.
    
    @dblotsky @nikhilkh @rakatyal please review.

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

    $ git pull https://github.com/MSOpenTech/cordova-medic CB-10433

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

    https://github.com/apache/cordova-medic/pull/76.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 #76
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/76#discussion_r52387149
  
    --- Diff: medic/medic-run.js ---
    @@ -372,13 +372,13 @@ function main() {
             //      timeout needs to be in milliseconds, but it's
             //      given in seconds, so we multiply by 1000
             testwait.init(couchdbURI);
    -        testwait.waitTestsCompleted(buildId, timeout * 1000).then(
    +        testwait.waitTestsCompleted(buildId, timeout * 1000, false).then(
                 function onFulfilled(value) {
    -                util.medicLog("got test results");
    +                util.medicLog("Successfully found test results");
                     process.exit(0);
                 },
                 function onRejected(error) {
    -                console.error("didn't get test results: " + error);
    +                console.error("Could not find test results: " + error);
    --- End diff --
    
    It will be great to suggest that a failure indicates a crashed app. Checking platform specific logs for crash reason is a good idea.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/76#discussion_r52818827
  
    --- Diff: medic/medic-run.js ---
    @@ -404,26 +459,51 @@ function main() {
             }
     
             // run the code
    -        // NOTE:
    -        //      this is ASYNCHRONOUS
             util.medicLog("running:");
             util.medicLog("    " + runCommandDevice);
    -        shelljs.exec(runCommandDevice, {silent: false, async: true}, function (returnCode, output) {
    -            if (failedBecauseNoDevice(output)) {
    -                util.medicLog("no device found, so switching to emulator");
    +        var runDeviceResult = shelljs.exec(runCommandDevice, {silent: false, async: false});
    +
    +        if (failedBecauseNoDevice(runDeviceResult.output)) {
    +            util.medicLog("no device found, so switching to emulator");
    +
    +            // Because the Android emulator script uses promises, we need to
    +            // abstract the run step into a function
    +            var runOnEmulator = function() {
                     util.medicLog("running:");
                     util.medicLog("    " + runCommandEmulator);
    -                shelljs.exec(runCommandEmulator, {silent: false, async: true}, function (returnCode, output) {
    -                    if (cordovaReturnedError(returnCode, output)) {
    -                        util.fatal("running on emulator failed");
    +
    +                var runEmulatorResult = shelljs.exec(runCommandEmulator, {silent: false, async: false});
    +                if (cordovaReturnedError(runEmulatorResult.code, runEmulatorResult.output)) {
    +                    util.fatal("running on emulator failed");
    +                } else {
    +                    startPollingForTestResults(couchdbURI, buildId, timeout);
    +                }
    +            };
    +
    +            if (platform === util.ANDROID) {
    +                // We need to start the emulator first. We can't use "cordova run"
    --- End diff --
    
    Nitpick: please add a blank line before comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on the pull request:

    https://github.com/apache/cordova-medic/pull/76#issuecomment-182121613
  
    LGTM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-medic/pull/76#issuecomment-183422034
  
    I updated the error message based on @nikhilkh's feedback. I also pushed the emulator retry logic to this branch (which was a bad idea) and now I need to split up this PR. I'm going to merge in the first two commits of this PR if it looks good and open another for the Android retry stuff. @nikhilkh can you take a quick look at e6afb23 to see if the error message update is okay?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-medic/pull/76#issuecomment-183432634
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: CB-10433: Removing the ETIMEDOUT error...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-medic/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org