Improve android install robustness.

Review Request #3725 — Created April 19, 2016 and submitted

jsirois
pants
jsirois/android/fail_ci_faster
3225
pants-reviews
mateor
This change sets up the script to fail-fast; thus fail Travis-CI more
quickly and clearly when there are android install errrors. It also
succeeds more quickly when the install has already completed successfully
once for a given android sdk tarball and module list.

 .travis.yml                              |  6 ++--
 build-support/bin/install-android-sdk.sh | 77 ++++++++++++++++++++++++++++----------------------
 2 files changed, 46 insertions(+), 37 deletions(-)
Extensive local testing with various interrupts.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/124303065
JS
JS
  1. NB: This looks like it should save ~80s per shard in the before_script, caching was effectively being ignored previously.

  2. 
      
MA
  1. Oh yeah. I ran it locally a bit. So much better.

    Thanks, John. I have another patch in the pipe that takes ~20 secs off android integration tests, so they should combine to be a nice boost to build times.

  2. So depending on how often this check runs, the license check will start failing for some packages - I guess they have some sort of rate limiting in place.

    But since it already passed once perhaps that won't be an issue anymore. I am fine with just using this and keeping the sleep in our back pocket in case of future issues.

    1. Well, I'm not sure rate limiting has anything to do with this.  I did confirm `yes` was not handled well by update, but I also observed exactly one y/n prompt, so I send exactly one y.  Now that is bogus of course if the number of license confirms is ever >1.  Presumably that can't happen for a fixed SDK version?  Or can it?
    2. It depends on what you are installing I guess. I was using the echo y| xyz until it started failing. You can see others hit this issue in reports like:

      https://discuss.circleci.com/t/circleci-not-compiling-on-gradle-2-0-failed-to-resolve-support-annotations-23-3-0/3396
      and the third comment here:
      https://github.com/journeyapps/android-sdk-installer/issues/5

      I think it depends on the modules that are getting installed? Like I said in the comment - it wasn't deterministic - sometimes it would pass and then it would start failing. But like I said, this does the check a lot less than it did before - I am okay with just resurrecting the sleep if/when problems reoccur.

    3. Aha - nasty.  It does look like the list of licenses to accept can float in time even given an explicit `--filter`.  OK - will leave as-is then until we blow up.
  3. 
      
JS
JS
Review request changed

Status: Closed (submitted)

Change Summary:

Now on master:

git log -1 origin/master
commit cdca712412301b72b08cfb7501e117b9597d21ae
Author: John Sirois <john.sirois@gmail.com>
Date:   Tue Apr 19 16:51:42 2016 -0600

    Improve android install robustness.
    
    This change sets up the script to fail-fast; thus fail Travis-CI more
    quickly and clearly when there are android install errrors. It also
    succeeds more quickly when the install has already completed successfully
    once for a given android sdk tarball and module list.
    
    Testing Done:
    Extensive local testing with various interrupts.
    
    CI went green here:
      https://travis-ci.org/pantsbuild/pants/builds/124303065
    
    Bugs closed: 3225
    
    Reviewed at https://rbcommons.com/s/twitter/r/3725/
Loading...