Silk Test Open Agent doesn't stop automatically after tests execution - java

I have an issue with Silk Test's Open Agent (Silk Test 2011).
I am using Silk4J for acceptance tests written in Java for a C++ client. It starts the tests properly but does not stop after the tests are completed. I have to do it manually so the job is completed in Jenkins.
Silk Test 2011 with Hotfix3 is installed on my Windows 7 SP1 (64bit).
The Silk Test 2011 release notes mention turning off user access control and I have done so.
I am having a hard time isolating the problem and hope somebody may have some ideas.

Silk Test's Open Agent should not be blocking your tests from completion.
In the past I've seen similar issues by the Java VM leaking sockets to their child processes, which then occasionally causes another processes to think the JVM was still alive.
You could try
Upgrading the involved JVM(s)
Upgrading Silk Test (2011 is ancient)
Take a close look at the network sockets the various processes have open, if the first two steps don't solve your issue, this might help you find out why.

Related

Test case failing randomly while building Selenium automation in jenkins

I am trying to run jenkins job for my automation. Here I am using cucumber Bdd. While running locally in single thread, test cases are working good. But while building the job in jenkins using multiThreading, test cases are failing randomly. Once one is passed , in the successive build it is getting failed. Most of them are having the below error. It seems like there is some server issue that page is not loading in the browser while running the test cases. Can you suggest any way out to run this successfully?
My whole test cases are so large in size that if not run in multiThread it will take 6 to 7 hrs . The server is not supporting such long time. It is getting socket timeout after half of the run(after 3 hrs.)
org.openqa.selenium.TimeoutException: Course wasn't loaded after 30
seconds. Build info:
version:'2.53.1',revision:'a36b8b1cd5757287168e54b817830adce9b0158d',time:
'2016-06-30 19:26:09' System info: host: 'jenkins-50a5c8e3',
ip:'100.64.111.138',os.name:'Linux',os.arch:'amd64',os.version:'2.6.32-5-xen-amd64',java.version:'1.8.0_40'Driver
info:driver.version:unknown
This question is a bit vague so the best I can do is give a vague answer of what you might want to look into.
Make sure your tests can run in isolation You mentioned it works in a single thread. If your tests don't each have isolated data (course, user, whatever) then it's really easy to have one test do something like remove a course while another test is trying to access it if you run them in parallel.
Timing issues If you have timing issues in your tests, you probably need more robust explicit waits.
Make sure you properly dispose of your driver Preferably in a finally block. You need to make sure that no matter what path your tests take, the driver will get closed. You might want to start a strategy as well to clean up stranded driver instances, restart nodes, etc...

How to signal a test to stop in TestNG?

I have written tests for my windows based application in TestNG. Sometimes my tests will result in BSOD of windows, so the test will run waiting for the Windows to be up till timeout and fail.
I have written a Listener for BSOD detection and handling, so that whenever the test starts the BSOD detector will start as listener and handle if the BSOD occurs. But still I have no way to notify my test that it has to halt. It still continues to execute till timeout.
How can solve this problem? Is there a way to notify the test to terminate it from Listener?
I think you may be out of luck.
The discussion at https://groups.google.com/forum/#!topic/testng-users/BkIQeI0l0lc clearly indicates that, as of August 2012 there was no way to stop a running test suite.
That combined with a much older post (https://groups.google.com/forum/#!topic/testng-users/FhC3rqs1yDM) from February 2010 suggests it has been a shortcoming of TestNG for a while.
The current TestNG documentation does not describe any methods for stopping the suite.
From what I can see in the source code (although I have not traced through all paths) at https://github.com/cbeust/testng/blob/master/src/main/java/org/testng/TestNG.java, it simply creates new tasks for each test and runs them, providing no way to break early.
Perhaps you could modify your tests to have access to some flag that indicates if subsequent tests should be skipped (triggered by, e.g., the BSOD detector). Then all of your subsequent tests are responsible for indicating themselves as skipped if this flag is set. It might not be ideal, but one way to think about it is: Any test should be skipped if a BSOD (or other terminal event) was detected prior to that test.
You could request this feature on the TestNG Google Group (linked above). If you are so inclined, you could also perhaps customize the TestNG source.

Experiencing high cpu consumption running Selenium-Server-standalone as a windows service

Thank you for viewing my post.
I'm running selenium-server-standalone as a windows service utilizing nssm(- the Non-Sucking Service Manager | http://nssm.cc/), utilizing the identical process as mentioned in this stackoverflow post #: https://stackoverflow.com/a/10656979/956863.
Quick Summary of post:
Download and extract nssm.exe
Installed NSSM and from the command line ran: nssm install Selenium-Server "C:\Program Files\Java\jre6\bin\java.exe" "-jar C:\Selenium\selenium-server-standalone-2.24.1.jar"
The machine where I'm running this process is running windows XP, service pack 3. This solution to run selenium server as a service works like a charm, and when selenium server is running, and crashes for some reason, selenium server successfully restarts without manual intervention.
But I"m coming into work, and am being informed by system administrators that high cpu alerts are being thrown. And again system logs are providing no information... So I'm wondering if selenium is actually the cause of this issue, and want to eliminate the possibility of running selenium as a service being blamed for this cpu spike.
Can anyone think of a solution, perhaps a way to stop the selenium service when cpu utilization reaches X amount? Or?
In the meantime, I'm going to set some sort of long term CPU utilization monitor and see if that can see something that the system monitor in xp may be missing. ( If anybody knows of a good way to achieve this, i'm open to suggestions as well )
I have selenium running as a service on windows 2008 server and noticed that its not able to clean up the headless browser instances. My tests are written in JavaScript with Soda so I have a start up and close out the browser instances but running as a service it doesn't close out those instances in the task manager.
I actually have two ways I'm running the service one way is where I'm using a bat file to run selenium the other way I have it running directly off a registry key.
I was able to fix the browser issue after I just added another step process to teamcity to run taskkill automatically on any browsers left open when the tests were complete. This fixed my CPU spiking issue.
Despite having vague reports of CPU spikes with Selenium as a service, I have yet to see one with my own eyes. Which version of Java are you using?
Our commercial run-anything-as-a-service product supports CPU tracking and can restart Selenium when it hogs the CPU. I suggest that you download the free 30-day trial and use it see if you can confirm or rule out Selenium as the problem in that time frame. Follow this guide to set up Selenium as a service.

Powershell process from java - Process may "delay" (Not hang) on some environments

We are creating a bunch of PoSH scripts and running them in an orderly manner from Java
(Building a process, handling all input/output streams that may cause hangups, and then invoke it using local admin privileges).
We are facing an interesting occurrence in some of our deployments.
When tracking the log file of this operation we sometime see a considerable delay. The
delay is consistent and clocks at 35 seconds:
If there's a log listing just prior to the process building and the next logging is done
from the invoked PoSH script - The delay between them is consistent and of 35 seconds.
It is consistent for all scripts invoked on that machine.
This behavior is not consistent. We have several (unrelated) machines that exhibit that behavior, but also many other that show 2-5 seconds which we accept as a normal time for building the process.
Our Java process is a 32bit process, and most of the delaying machines are 64bit VMs of Win2K8 server R2. Most of these VMs are using domain authentication and policies (Different ones of different customers).
We tried running the Powershell via various different methods (Such as PSTools) but with no real findings - It always starts in a few seconds. Comparing machine installations did not bring us any insights either. Performance does not seem to be an issue either though I'll admit we haven't analyzed it too deeply, just looked closely at the task manager.
It is important to mention that the process never hangs - It will run and run swiftly when started. The delay is happening during the startup of the PoSH process.
Any ideas, advices or speculative directions will be more than welcome.
Thanks,
Yaron

Java Applet starts up very slowly for some users?

[UPDATE: I forgot to add that this 30 sec. freezing problem only happens the first time I try to load a file from the server. Subsequent loads are very quick. Maybe some strange reverse DNS lookup? I am hosting on Google's appengine.]
I started a little project recently called http://www.chartle.net which is build around an applet.
Startup time is an important factor in the user's experience of an applet. I collect statistics and am shocked that I find often very long startup times (factor 50 to 100 higher then necessary)
The applet starts in 1-3 seconds depending on the speed of your computer and connection. Still for some users it takes up to 100 sec.
I have mixed results from my own tests. Mostly it is very fast but sometimes freezes the browser for a long time and the Java console doesn't tell me why. Best guess is, that it stalls when loading a saved chart.
Please help me figuring this out - best test by opening an already saved chart (click on one of the 'create' links at http://www.chartle.net/gallery)
Cheers,
Dieter
This is generic help rather than specific for your demo (which loaded fine for me in a few attempts).
Freezing applets
In the JDK bin directory there is a very handy programme called jstack. Refresh your browser window until it crashes and then run:
jstack *process_id*
This will give you the stack trace of any frozen Java process. If Java is not a separate process then you can use the browser's process (eg for Opera).
The following few problems were/are common for me:
I reccommend you use invokeLater rather than invokeAndWait on the init method (although you can't do this if you use start/stop methods)
Opera's custom java plugin acts very poorly...
Deadlocks caused by synch blocks and invokeAndWait's
Slow applets
Possibly the browser is fetching resources from the server, unable to use the jar file?
It may be that only the old plugin causes these problems. That means basically all people running on OSX and other users with Java prior to 1.6_update_10.
So, I would really appreciate people with such setups to watch their Java console and describe the first startup behaviour.
Cheers,
Dieter

Categories

Resources