Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7693

Problem detecting that emulator is started.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Android Plugin doesnot detect correctly that the emulator is started.
      On my platform, i can see using a vncviewer that the emulator is well started but the android plugin
      doesnot detect it and finishes with a timeout.
      I think the problem is with the adb connect command (sometimes, the error "error: device not found" is raised and the
      connection is lost). I think that your plugin has to launch it each time before the getprop command. There is no matter
      executing it severals times even if you're already connected, you'll just have the message "already connected to ". But if the
      connection is lost, it will be recreate correctly again.

      Here is the log :

      [workspace] $ vncserver :14 New 'X' desktop is nansrvweb7:14 Starting applications specified in /home/hudson/.vnc/xstartup Log file is /home/hudson/.vnc/nansrvweb7:14.log [android] Using Android SDK: /appli/android-sdk-linux_x86 [android] Starting Android emulator $ /appli/android-sdk-linux_x86/tools/emulator -ports 53617,46049 -no-boot-anim -avd Android1.6 emulator: warning: opening audio output failed $ /appli/android-sdk-linux_x86/tools/adb connect localhost:46049 $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 logcat -v time [android] Waiting for emulator to finish booting... $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      $ /appli/android-sdk-linux_x86/tools/adb -s localhost:46049 shell getprop dev.bootcomplete
      [android] Timed-out after waiting 120 seconds for emulator $ /appli/android-sdk-linux_x86/tools/adb disconnect localhost:46049 [android] Stopping Android emulator [android] Archiving emulator log Terminating xvnc. $ vncserver -kill :14 Killing Xtightvnc process ID 18841 Finished: NOT_BUILT

        Attachments

          Activity

          Hide
          orrc Christopher Orr added a comment -

          Yes, the problems generally seems to be with the stability of adb.
          http://issues.jenkins-ci.org/browse/JENKINS-7354?focusedCommentId=141762&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_141762

          But that's a good idea, calling adb connect periodically during startup. I'll look at implementing that, thanks.

          However, note that this wouldn't help with adb crashes during your build, as shown in the above link.

          Show
          orrc Christopher Orr added a comment - Yes, the problems generally seems to be with the stability of adb. http://issues.jenkins-ci.org/browse/JENKINS-7354?focusedCommentId=141762&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_141762 But that's a good idea, calling adb connect periodically during startup. I'll look at implementing that, thanks. However, note that this wouldn't help with adb crashes during your build, as shown in the above link.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          http://jenkins-ci.org/commit/android-emulator-plugin/71989230f7d7d40b624015c8f5aadcb850fc1671
          Log:
          Auto-reconnect to ADB while checking for boot completion, in case ADB crashed.

          As suggested in JENKINS-7693, this prevents the build from failing due to an ADB crash.
          Such ADB crashes can sometimes be triggered by other emulators starting up in parallel.

          Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/13b2f02...7198923

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java http://jenkins-ci.org/commit/android-emulator-plugin/71989230f7d7d40b624015c8f5aadcb850fc1671 Log: Auto-reconnect to ADB while checking for boot completion, in case ADB crashed. As suggested in JENKINS-7693 , this prevents the build from failing due to an ADB crash. Such ADB crashes can sometimes be triggered by other emulators starting up in parallel. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/13b2f02...7198923
          Hide
          orrc Christopher Orr added a comment -

          This has been added in version 1.11.

          The plugin will automatically attempt to reconnect with ADB while waiting for the emulator to finish starting up.

          Also, with improvements to adb, the way in which the plugin connects with emulators, and snapshot support reducing build time, there should now be less chance of things going wrong!

          Show
          orrc Christopher Orr added a comment - This has been added in version 1.11. The plugin will automatically attempt to reconnect with ADB while waiting for the emulator to finish starting up. Also, with improvements to adb, the way in which the plugin connects with emulators, and snapshot support reducing build time, there should now be less chance of things going wrong!
          Hide
          randroid Roberto Andrade added a comment -

          I'm seeing the same behavior again and reopened https://issues.jenkins-ci.org/browse/JENKINS-11952

          Show
          randroid Roberto Andrade added a comment - I'm seeing the same behavior again and reopened https://issues.jenkins-ci.org/browse/JENKINS-11952

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              michenux michenux
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: