Re: Help required for Android plugin - 'use emulator snapshots'

2014-05-15 Thread Charles Chan
Figured out it's an old issue with 2.10 release:

https://github.com/jenkinsci/android-emulator-plugin/blob/android-emulator-2.10/src/main/java/hudson/plugins/android_emulator/Constants.java#L49

   static final String REGEX_SNAPSHOT = [0-9]+ ++ SNAPSHOT_NAME + +[0-9]+M ;


Since the regex looking for M (megabyte) and my snapshot is 1.0G. The 
regex fails and the snapshot is not found.

This has been fixed in the head.

On Tuesday, May 13, 2014 12:31:01 PM UTC-7, Charles Chan wrote:

 Thanks for the information.

 I try setting to emulator-x86 again and I still get the same behaviour 
 from Jenkins:
 $ /opt/android-sdk-linux/tools/emulator-x86 -snapshot-list -no-window -avd 
 hudson_en-US_160_WVGA_android-19_x86

 [android] Starting Android emulator and creating initial snapshot


 However, if I execute from the command line, I can see the snapshot are 
 present:

 $ /opt/android-sdk-linux/tools/emulator-x86 -snapshot-list -no-window -avd 
 hudson_en-US_160_WVGA_android-19_x86
 Snapshots in file 
 '/home/jenkins/.android/avd/hudson_en-US_160_WVGA_android-19_x86.avd/snapshots.img':
  IDTAG VM SIZEDATE   VM CLOCK
  1 jenkins1.0G 2014-05-13 12:11:26   00:07:51.870


 Any ideas?


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help required for Android plugin - 'use emulator snapshots'

2014-05-13 Thread Charles Chan
Thanks for the information.

I try setting to emulator-x86 again and I still get the same behaviour 
from Jenkins:
$ /opt/android-sdk-linux/tools/emulator-x86 -snapshot-list -no-window -avd 
hudson_en-US_160_WVGA_android-19_x86

[android] Starting Android emulator and creating initial snapshot


However, if I execute from the command line, I can see the snapshot are present:

$ /opt/android-sdk-linux/tools/emulator-x86 -snapshot-list -no-window -avd 
hudson_en-US_160_WVGA_android-19_x86
Snapshots in file 
'/home/jenkins/.android/avd/hudson_en-US_160_WVGA_android-19_x86.avd/snapshots.img':
 IDTAG VM SIZEDATE   VM CLOCK
 1 jenkins1.0G 2014-05-13 12:11:26   00:07:51.870


Any ideas?

On Tuesday, May 13, 2014 2:24:17 AM UTC-7, Christopher Orr wrote:

 On 10/05/14 00:49, Charles Chan wrote: 
  I have been trying to use the snapshot functionality in the Android 
  plugin but somehow it keeps creating a new snapshot every time. 
  
  I looked at the code EmulatorConfig.hasExistingSnapshot(), and saw the 
 comment. But I don't think it apply? 
  
   // Work around 
   // https://code.google.com/p/android/issues/detail?id=34233 
   // by always using EMULATOR_ARM to view the snapshot list. 

 That bug does apply.  That code you quoted isn't in a released build 
 yet; I'm aiming to do a new plugin release this week. 

 As mentioned here (and hinted at by that code), you can change the 
 emulator binary in your job config to get around that Android SDK tools 
 bug: 

 http://stackoverflow.com/questions/13381460/why-is-jenkins-android-emulator-plugin-recreating-my-emulator-snapshots-in-every
  

 Regards, 
 Chris 



-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help required for Android plugin - 'use emulator snapshots'

2014-05-09 Thread Charles Chan
I have been trying to use the snapshot functionality in the Android plugin 
but somehow it keeps creating a new snapshot every time.

$ /opt/android-sdk-linux/platform-tools/adb start-server

$ /opt/android-sdk-linux/tools/emulator -snapshot-list -no-window -avd 
hudson_en-US_160_WVGA_android-19_x86

[android] Starting Android emulator and creating initial snapshot

[android] Erasing existing emulator data...

$ /opt/android-sdk-linux/tools/emulator -no-boot-anim -ports 54032,48039 -prop 
persist.sys.language=en -prop persist.sys.country=US -avd 
hudson_en-US_160_WVGA_android-19_x86 -no-snapshot-load -no-snapshot-save 
-wipe-data -no-window -force-32bit

...

$ /opt/android-sdk-linux/platform-tools/adb -s localhost:60122 shell log -p v 
-t Jenkins Creating snapshot...

[android] Creating snapshot...

$ /opt/android-sdk-linux/platform-tools/adb connect localhost:60122

[android] Emulator is ready for use (took 705 seconds)

...



I can confirm the snapshot exists:

$ /opt/android-sdk-linux/tools/emulator -snapshot-list -no-window -avd 
hudson_en-US_160_WVGA_android-19_x86

Snapshots in file 
'/home/jenkins/.android/avd/hudson_en-US_160_WVGA_android-19_x86.avd/snapshots.img':

 IDTAG VM SIZEDATE   VM CLOCK

 1 jenkins1.0G 2014-05-09 14:07:09   00:08:23.364



But if I restart the job again, the log will show the saw message:

$ /opt/android-sdk-linux/tools/emulator -snapshot-list -no-window -avd 
hudson_en-US_160_WVGA_android-19_x86

[android] Starting Android emulator and creating initial snapshot

[android] Erasing existing emulator data...



I looked at the code EmulatorConfig.hasExistingSnapshot(), and saw the comment. 
But I don't think it apply?

// Work around
// https://code.google.com/p/android/issues/detail?id=34233
// by always using EMULATOR_ARM to view the snapshot list.



How can I figure out what's wrong? (Note: Running OS CentOS 6.4 64bit Linux)

Thanks,
Charles

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does the Android emulator work inside a VM?

2014-05-07 Thread Charles Chan
Summary: Does the Android emulator work inside a VM? Or must it be run on a 
bare metal machine?

I am trying to setup some automated tests using Jenkins with the Android 
plugin. The slave is a VM (on top) of VMWare ESXi, running Ubuntu Linux (32 
bit x86). When the emulator tries to start the VM, it shows an error 
Failed to Initialize backend EGL display and nothing happens.

[android] Using Android SDK: /home/hudson/hudson/tools/android-sdk

[android] Creating Android AVD: 
/home/hudson/.android/avd/hudson_en-US_160_1080x1920_android-19_x86.avd

[android] /home/hudson/hudson/tools/android-sdk/tools/android create avd -f 
-a -s 1080x1920 -n hudson_en-US_160_1080x1920_android-19_x86 -t android-19 
--abi x86
[android] Setting hardware properties:
hw.ramSize: 768
vm.heapSize: 64

$ /home/hudson/hudson/tools/android-sdk/platform-tools/adb start-server

$ /home/hudson/hudson/tools/android-sdk/tools/emulator -snapshot-list 
-no-window -avd hudson_en-US_160_1080x1920_android-19_x86
[android] Starting Android emulator and creating initial snapshot
$ /home/hudson/hudson/tools/android-sdk/tools/emulator -no-boot-anim -ports 
45507,44892 -prop persist.sys.language=en -prop persist.sys.country=US -avd 
hudson_en-US_160_1080x1920_android-19_x86 -no-snapshot-load 
-no-snapshot-save -wipe-data -no-window -noaudio -gpu off
* daemon not running. starting it now on port 39784 *
* daemon started successfully *
Failed to Initialize backend EGL display
...
emulator: WARNING: Could not initialize OpenglES emulation, using software 
renderer.

I tried with different abi (x86|x86) and options (combinations of -noaudio 
-gpu off). All failing. I also tried to login to the console and launch the 
emulator manually. All I see is a black emulator window. The emulator 
process is actively running ('top' command), but I don't see the home 
screen.

Thanks,
Charles

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins slave appear offline - SSHLauncher threads BLOCKED

2014-05-06 Thread Charles Chan
Thanks for the confirmation.

On Tuesday, May 6, 2014 4:40:59 AM UTC-7, Stephen Connolly wrote:

 Yes, it sounds like there is a race condition between the post disconnect 
 tasks and the reconnect tasks: 
 https://github.com/jenkinsci/ssh-slaves-plugin/blob/ssh-slaves-1.6/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L1152is
  blocking until the slave is connected... but the slave cannot connect 
 until the disconnect tasks are complete... 


Is there any workaround for this issue? eg. Would it help if we download to 
an older version (which one)?
Secondly, is a fix scheduled for this? Or do I need to create an issue 
first?

Cheers,
Charles 

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins slave appear offline - SSHLauncher threads BLOCKED

2014-05-05 Thread Charles Chan


Hello,

One of the issue we have recently been experiencing with Jenkins is that the 
slaves (node) would go offline for no apparent reason and would not reconnect 
automatically.
When slaves appear as offline, we tried to launch/reconnect the slave manually 
but it does not work either. However, we are able to SSH into the machine using 
PuTTy.
The only workaround is to restart the Jenkins server, until the problem 
surfaces again. (Typically in a week.)

Instance Information

Jenkins Server:1.562
SSH Credentials Plugin:1.6.1
SSH Slaves Plugin  1.6

Thread dump of slave node:
{dump}
Channel reader thread: qa-linbuild-02 prio=5 WAITING
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)

com.trilead.ssh2.channel.ChannelManager.waitUntilChannelOpen(ChannelManager.java:109)

com.trilead.ssh2.channel.ChannelManager.openSessionChannel(ChannelManager.java:583)
com.trilead.ssh2.Session.init(Session.java:41)
com.trilead.ssh2.Connection.openSession(Connection.java:1129)
com.trilead.ssh2.SFTPv3Client.init(SFTPv3Client.java:99)
com.trilead.ssh2.SFTPv3Client.init(SFTPv3Client.java:119)

hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1160)
hudson.slaves.SlaveComputer$2.onClosed(SlaveComputer.java:437)
hudson.remoting.Channel.terminate(Channel.java:819)

hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:76)

Channel reader thread: qa-linbuild-03 prio=5 WAITING
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)

com.trilead.ssh2.channel.ChannelManager.waitUntilChannelOpen(ChannelManager.java:109)

com.trilead.ssh2.channel.ChannelManager.openSessionChannel(ChannelManager.java:583)
com.trilead.ssh2.Session.init(Session.java:41)
com.trilead.ssh2.Connection.openSession(Connection.java:1129)
com.trilead.ssh2.SFTPv3Client.init(SFTPv3Client.java:99)
com.trilead.ssh2.SFTPv3Client.init(SFTPv3Client.java:119)

hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1160)
hudson.slaves.SlaveComputer$2.onClosed(SlaveComputer.java:437)
hudson.remoting.Channel.terminate(Channel.java:819)

hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:76)
{dump}

Also concerning is the number of threads is in the BLOCKED (126!). 
Doesn't seem normal as there are no BLOCKED threads after the server is 
restarted.
{dump}
// 118 instances
Computer.threadPoolForRemoting [#26] daemon prio=5 BLOCKED

hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1152)
hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:542)

jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

// 8 instances
Computer.threadPoolForRemoting [#2922] daemon prio=5 BLOCKED
hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:639)
hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:222)

jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
{dump}

Looking forward to any ideas or suggestions.

Thank you.
Charles Chan

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins slave appear offline - SSHLauncher threads BLOCKED

2014-05-05 Thread Charles Chan
On Monday, May 5, 2014 2:26:19 PM UTC-7, Kevin Fleming wrote:

 Unfortunately it's not possible to reconnect to an SSH session; if the 
 session is disconnected, the SSH daemon on the receiving end will close its 
 end, and kill any processes that had been launched by that connection. In 
 other words, any job that was running will be lost.


Fair enough. If the ssh session is disconnected, the existing job shall be 
terminated and the slave appears offline.

It appears Jenkins has the ability to automatically reconnect via SSH 
(bring the slave online) but is blocked. Subsequent attempts to reconnect 
manually will then fail as well until a server restart -- even if the slave 
is accessible via PuTTy. 

It would be nice to be able to figure out how these SSHLauncher threads 
were spawned in the first place, the root cause of the blocked threads, and 
how to recover from the incident after. 

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


CI and optimize build time

2014-04-07 Thread Charles Chan
I came across this article from the Google Testing Blog a while ago:
http://googletesting.blogspot.ca/2011/06/testing-at-speed-and-scale-of-google.html

As our builds are taking longer run, I wonder if there is any tools/plugins 
available to help implement the pipeline described in the article:
* analyze code changes and dependencies
* re-run test case based on changes
* split job into jobs automatically if it is advantageous to do so

Projects are mostly Maven based, some Ant (Android / C++)

Look forward to any feedback.

Thanks!
Charles

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is it possible to scan for warnings in Visual Studio PREfast files

2014-02-20 Thread Charles Chan
In our Jenkins job, we set up Visual Studio to run the static code 
analysis. This produces an XML file, similar to the one above. We would 
like to use the plugin Scan for compiler warnings to monitor the number 
of violations. I have tried a number of different parser, but it doesn't 
seem to be picking up on the defects.

Example PREfast XML file
https://code.google.com/p/cstracker/source/browse/trunk/CsTracker/Sys/PREfast_defects_chk_wlh_x86.xml?r=4

Looking for pointer from anyone who might have done something similar.

Thanks in advance.
Charles

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.