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/11 23:00:43 UTC

[GitHub] cordova-android pull request: CB-10510: Add an optional timeout to...

GitHub user riknoll opened a pull request:

    https://github.com/apache/cordova-android/pull/258

    CB-10510: Add an optional timeout to emu start script

    The `emulator.js` script waits forever for the emulator to boot. If the emulator gets stuck, it will never terminate. The reason for adding this timeout is that the Android emulator on Windows occasionally hangs while booting up. This causes problems in our CI, where the run step would go on forever until buildbot eventually cut it off (see [here](https://ci.apache.org/builders/cordova-android-win/builds/1588/steps/running-tests/logs/stdio) for an example run). I have an upcoming PR for cordova-medic that switches from using `cordova run` to start the emulator to requiring this script directly so that we can add retry logic for the emulator start. I don't think it really makes sense to expose the timeout option in the CLI itself, so this PR does not alter the CLI's behavior at all (it will still hang). I'm not sure if we should add in a default timeout or not.

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

    $ git pull https://github.com/MSOpenTech/cordova-android CB-10510

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

    https://github.com/apache/cordova-android/pull/258.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 #258
    
----
commit 723393168127524f5f23d931bbcf171edbd08d39
Author: riknoll <ri...@gmail.com>
Date:   2016-02-11T21:37:00Z

    CB-10510: Add an optional timeout to emu start script
    
    The script used to wait forever for the emulator to boot.
    If the emulator got stuck, it would never terminate.
    This timeout is being added to support cordova-medic and
    the CI.

----


---
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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#issuecomment-184808170
  
    @vladimir-kotikov can you take a quick look at this? I want to make sure I'm not messing with the platform API at all given that we don't have any tests for this code path.


---
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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258


---
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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#issuecomment-183431397
  
    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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#issuecomment-184821410
  
    @omefire 


---
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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#discussion_r52795575
  
    --- Diff: bin/templates/cordova/lib/emulator.js ---
    @@ -227,18 +236,25 @@ module.exports.wait_for_emulator = function(uuid) {
     };
     
     /*
    - * Waits for the core android process of the emulator to start
    + * Waits for the core android process of the emulator to start. Returns a
    + * promise that resolves to a boolean indicating success. Not specifying a
    + * time_remaining or passing a negative value will cause it to wait forever
      */
    -module.exports.wait_for_boot = function(emulator_id) {
    +module.exports.wait_for_boot = function(emulator_id, time_remaining) {
         var self = this;
         return Adb.shell(emulator_id, 'ps')
         .then(function(output) {
             if (output.match(/android\.process\.acore/)) {
    -            return;
    +            return true;
    +        } else if (time_remaining === 0) {
    +            return false;
             } else {
                 process.stdout.write('.');
    -            return Q.delay(3000).then(function() {
    -                return self.wait_for_boot(emulator_id);
    +
    +            // Check at regular intervals
    +            return Q.delay(time_remaining < CHECK_BOOTED_INTERVAL ? time_remaining : CHECK_BOOTED_INTERVAL).then(function() {
    --- End diff --
    
    Maybe use `Math.min` here instead of the ternary operator? It's a little hard to read long ternary conditions.


---
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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#issuecomment-183480745
  
    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-android pull request: CB-10510: Add an optional timeout to...

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

    https://github.com/apache/cordova-android/pull/258#issuecomment-183427884
  
    @dblotsky @nikhilkh please review


---
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