Jenkins doesn't launch the application under test on chromebrowser - google-chrome

I ran into an issue with Jenkins which I've never seen before and I thought I'll get some advice. Jenkins wouldn’t launch the AUT on the chrome browser for running selenium tests.
Steps that I followed:
A Jenkins Master and Slave are setup on the same machine. Not as a windows service, but I launch them manually via command prompt
I setup a project on the Slave node with 2 build steps. One for the MSBuild (I dowloaded the plugin) to build the solution and the second step for executing the windows batch command that will start the tests
I also have a TFS plugin to fetch the server version of the solution to build on Jenkins
So when I build the job on Jenkins Slave,
The solution gets built successfully without any errors
Then for the next build step, Jenkins executes the windows batch command and loads the .dll file. Says “starting execution..”
Chromedriver launches. It opens up the chrome browser
But the chrome browser wouldn’t launch the AUT. It just tries to load it and stays intact indefinitely until my Jenkins job times out
With all this happening, my CPU utilization is at 100%. The browser that runs the Jenkins UI on the local host and Java.exe*32 consumes it to the fullest
I ran the exact same MSTest.exe command (that I entered in the build step) in command prompt when Jenkins is not running and it launches the AUT successfully and tests ran
I ran the exact same MSTest.exe command (that I entered in the build step) in command prompt when Jenkins is running. It again spikes the CPU to 100% and AUT never launches
Any thoughts?

I was also running into this issue and solved it as follows.
Basically the jenkins slave has to be started from the startup through a batch job.
Here is the step by step process.
Node URL : http://host:port/computer/nodeName/
Go to the node "Node URL"
Click on "Mark this node temporarily offline"
Go the the machine where slave is running.
Open command prompt in admin mode.
cd to the location where jenkins is installed
Execute jenkins-slave uninstall
Go to services (type services in run) and stop the jenkins slave running
Restart the machine.
cd C:\Users\myUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Create a new batch job (name say LaunchJenkinsSlave.bat) with following content
>
java -jar C:/Jenkins/slave.jar -jnlpUrl http://host:port/computer/nodeName/slave-agent.jnlp -secret yourSecret
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
<<
fyi : You can refer jenkins-slave.xml in your Jenkins install location for yourSecret, nodeName, host ect if you forgot.
Restart your machine.
Observation : Jenkins slave will be started automatically
12. Go to the "Node URL"
and bring the node back online.
Hope this helps.

Related

How must Teamcity be configured to work withtout SVC?

I am new in Teamcity and I created a Build, with a RunScript step.
I changed nothing in the source control configuration of this step.
The goal of the Build step is to run a script nothing else.
When running the build, Teamcity tries to do a source checkout (not configured) and stays blocked there.
What is the correct Teamcity SVC configuration in order that the build works even when SVC is not configured? Is it even possible or I should configure a fake SVC system like GIT to get it running?
With Teamcity, as with TFS, when you want to handle UI Tests, you should install the Test Agents as Interactive and not as Service.
If you Install them as Services, you will not have access to all the functionalities you need for UI testing.

Elastic Beanstalk stops at EbExtensionPostBuild

I am having a problem deploying an EB instance with a custom .ebextensions file. This is the relevant part in that file:
container_commands:
01_migrate:
command: 'python db_migrate.py'
02_npm_build:
command: 'npm install && npm run prod'
As you can see, these commands are for migrating my PostgreSQL database (via a Flask backend) and building my React .jsx files.
If I leave these commands out, the deployment completes perfectly well. However, once I put them in, looking at the eb-activity.log it stalls at this part forever (as far as I can tell):
[2017-04-10T02:39:24.106Z] INFO [3023] - [Application deployment app-613e-170409_223418#1/StartupStage0/EbExtensionPostBuild] : Starting activity...
I also get this message on the Health overview in the console (this is after 1 day):
Performing application deployment (running for 1 day).
I have also tried to deploy it without those container_commands, and then including it back after the successful initial deployment. Then I get the same error message as before in eb-activity.log, and I also get this message on the Health overview:
Incorrect application version "app-2a3d-170409_214923" (deployment 1). Expected version "app-2a3d-170409_214923" (deployment 1).
Which is very strange because those two versions referenced are the same versions. I don't know what this means!
I found a solution.
Remove all you container_commands from .ebextensions/
Go ssh to instance, kill process with.
sudo killall python
Then Deploy new version without container_commands.
And start debuging all your container_commands, one by one on ssh..
Have fun.

Chrome crashing when launched by Karma executed from MSBuild

My build server service is executing the following command from an msbuild file:
Exec Command="karma start $(LandscapeExplorerProjectFolder)karma.conf.js -- log-level debug
This then launches a Karma instance running on Node.js
Karma is configured to launch Chrome to run my Jasmine tests. When I execute the above command manually by logging on to the server and typing into the command prompt, the tests run as I would expect.
However when Karma is started by my build service, Chrome is initially launched but then crashes.
From the output of the console when running a build I get the following:
WARN [launcher]: [39mChrome have not captured in 60000 ms, killing.
DEBUG [launcher]: [39mProcess Chrome exited with code 0
When looking in the Chrome log I see:
[6888:2988:1105/162913:ERROR:child_process_launcher.cc(444)] Failed to launch child process
[6888:2988:1105/162913:WARNING:sad_tab_view.cc(105)] Tab Killed: http://localhost:9876/
The exact same console command works fine when executed manually, but there is something about the way the build service is executing things that is causing Chrome to crash. Does anyone have any ideas about this?
I've seen this issue before.
I was not able to resolve it, but was able to workaround it.
This seems to be related to running Jenkins as SYSTEM account on Windows - if this is the case, try changing the service to run as a service account.
I worked around this with PSexec - you can download the tool at:
https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
And then use it in the job to exec Karma:
C:\Path\to\pexec.exe -s -i -accepteula karma start $(LandscapeExplorerProjectFolder)karma.conf.js -- log-level debug
Again this seems to be related to spawning child processes with SYSTEM.

Why won't my NAnt builds run in Hudson?

My NAnt builds run fine locally on a developer machine, and locally on the command line of the Hudson server, but they will not run in my configured Hudson project.
The console output when I run a Build via the Hudson web UI is similar to the following :
Started by user anonymous [workspace]
$ sh -xe
C:\WINDOWS\TEMP\hudson8104357939096562606.sh
C:\WINDOWS\TEMP\hudson8104357939096562606.sh:
fork failed: no error [1] Archiving
artifacts Finished: SUCCESS
I have another project configured properly that runs fine so I know the NAnt plugin is setup properly in Hudson, and that NAnt is on the system path.
Can anyone suggest possible causes as to why this build won't run?
The problematic build may be configured to Execute a Shell script, rather than Execute a Windows Batch file.
Copy the command from the existing build step (the Execute Shell Script) and remove the step. Then add a new step to Execute a windows Batch File and paste the command.
Trigger the build and observe the results.
(I asked and answered this since it took me quite a while to figure out how I had mis-configured this particular build. Hopefully it'll save time or give ideas to other people trouble-shooting automation..)

How to deploy on a remote machine using hudson's WAS Builder Plugin?

I have a hudson build server (Windows) that does not have Websphere installed. I created a Hudson node that I connect to via SSH. I also installed the WAS Builder Plugin to run jython scripts on the AIX machine. The job that uses the WAS Builder Plugin is tied to the AIX box.
I run into errors. Does anybody know, whether that setup might work or if a different setup will work for the WAS Builder Plugin?
EDIT:
I get following Error Message:
[test] $ cmd /c call /tmp/hudson9035964108103168395.bat
FATAL: command execution failed
java.io.IOException: cmd: not found
at java.lang.UNIXProcess.fullPath(UNIXProcess.java:372)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:178)
at java.lang.ProcessImpl.start(ProcessImpl.java:114)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:466)
at hudson.Proc$LocalProc.<init>(Proc.java:149)
at hudson.Proc$LocalProc.<init>(Proc.java:121)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:633)
at hudson.Launcher$ProcStarter.start(Launcher.java:268)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:778)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:754)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:810)
Finished: FAILURE
I am wondering whether that plugin can be executed on a slave, especially in my case where the master is on Windows and the slave on AIX.
Check Here Hudson Deploy Websphere Plugin
Why dont you remotely trigger builds on Hudson via the hudsonurl:8080/jobs/jobname/build?token=TOKEN url. That way you dont have to depend on BAT files.
Finally I got it to work. I upgraded the plugin to Version 1.4 and to the newest Hudson server 1.355. That seemed to do the trick.