Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Can't connect to AUT using Jenkins...occasionally
Can't connect to AUT using Jenkins...occasionally [message #1076640] Wed, 31 July 2013 17:25 Go to next message
Youssef Bagoulla is currently offline Youssef BagoullaFriend
Messages: 6
Registered: July 2013
Junior Member
I'll do the short version first, then the long one after as I'm sure my setup is less than optimal:

Short story - Using jubula_7.1.00054, I've automated it to run a Jubula Job in Jenkins which contains multiple testsuites. All testsuites reference the same AUT which is started prior to running testexec. Occationally, not always, but occationally it will complete the first testsuite but then claim "!!Error occurred !! Could not connect to AUT" Running the Jenkins job again it makes it through all 5 test suites. Maybe 1 out of 10 times it fails to connect. What's going on here? Anyway to print more debug info? I have no idea how to repeat the issue.

Thoughts?


Long story - My setup feels really hacky so please recommend another solution if there is a more accepted practice.

Goal: Create multiple Jubula Jobs which contain multiple test suites which map to mulple Jenkins Jobs to tests my RCP Application. The AUT is the same for all jobs however the workspace used by each is unique per Jenkins/Jubula Job. Developers need only to drag and drop their Test Suite into a Jubula Job and hit Run on the Jenkins job to test out their test suite in a clean, known environment. In theory, these jobs can run in parallel on different VNCSERVERs which run unique AUT Agents on different ports.

Setup:

1.) Each Jenkins Job starts by pointing to:
a.) Jubula XML configuration file which defines: Project, Version, autconfig, dbscheme, dbuser, dbpw, server, port, language, & testjob.
b.) RCP Workspace
c.) VNC Display
d.) AUT Agent Port
e.) AUT_ID (Looks like I define this in the xml file as well, not sure if that's the problem...)

2.) Setup VNC Server on given display
3.) Start AUTAGENT on given port (bg the process)
Can't continue until the AUTAGENT is up and running, but autagent runs in fg unless backgrounded! How do you know when it's up?
4.) While port not open, sleep 1 sec. (Hacky solution #1)
Need to launch my AUT with a given workspace, autrun cannot be passed the -data flag to set AUT workspace! How can I set the workspace?
5.) On the fly, create temporary executable script which will launch my AUT with -data flag. (Hacky solution #2)
Can't launch testexec unless I know my application is loaded & jubula jar file has started! How can I tell via my bash script when the jubula jar has loaded?
6.) Sleep 30 seconds.....should be plenty of time (Hacky solution #3)
7.) Launch testexec pointing it to the XML configuration & result dir, and jubula workspace. This SHOULD run through all testsuites and the AUT should stay up and running the whole time. 90% of the time it works just fine. Occationally it only makes it through the first testsuite and then it claims it can't connect to AUT...the but AUT hasn't changed and is still running!
8.) Stop AUT Agent for particular port
9.) remove temporary script.
10.) Kill VNC Server

So...thoughts?
Re: Can't connect to AUT using Jenkins...occasionally [message #1077186 is a reply to message #1076640] Thu, 01 August 2013 10:45 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Youssef,

Thanks for the information! The problem with the connection is something we hope to have fixed.

For your other points:
1. We know that the synchronization between the testexec / agent / autrun is not ideal. We currently use a script that checks the availability / non-availability of the agent port to dynamically check whether the agent is there or not. It sounds a bit like what you use. Let me know if you want it anyway.
2. For the other two, I'm idea-less at the moment Smile you could put in enhancements for them if you could describe them abstractly.

Thanks for your input!
Alex
Re: Can't connect to AUT using Jenkins...occasionally [message #1077345 is a reply to message #1077186] Thu, 01 August 2013 15:14 Go to previous messageGo to next message
Youssef Bagoulla is currently offline Youssef BagoullaFriend
Messages: 6
Registered: July 2013
Junior Member
Awesome! Thanks Alex. To grab a version of jubula which has that change set in it, is there a nightly build of the full product I can grab? I've found the jubula-nightly Hudson job at https://hudson.eclipse.org/hudson/job/jubula-nightly/ Is that all I need to grab and drop into my plugins folder of my existing Jubula install or will this not play nice with my current install & jubula/bin executables?

Also, for anyone interested, I made step #6 less hacky. I created an eclipse plugin that I activate in the same way you have to manually activate the jubula jar. My plugin will check the list of loaded bundles every second until it sees the jubula jar has loaded. It then writes a file that I can check for in my script. I can send anyone interested the full content but the meat of it is:


while (!jubulaLoaded) {
  Bundle[] bundles = bundleContext.getBundles();
  for (int i = 0; i < bundles.length; i++) {
    String bundleName = bundles[i].getSymbolicName();
    if (bundleName.toLowerCase().contains("jubula")) {
       // Write a file or do something
    else
      // sleep or wait for a maximum of 1 minute or 30 seconds or whatever you want
Re: Can't connect to AUT using Jenkins...occasionally [message #1080731 is a reply to message #1077345] Tue, 06 August 2013 10:16 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Youssef,

I'm not sure where you should get a version - can you ask the dev list?

Thanks as well for the example!

Alex
Re: Can't connect to AUT using Jenkins...occasionally [message #1082501 is a reply to message #1080731] Thu, 08 August 2013 16:58 Go to previous messageGo to next message
Youssef Bagoulla is currently offline Youssef BagoullaFriend
Messages: 6
Registered: July 2013
Junior Member
Checked out the git repo, built the particular git hash and used the org.eclipse.jubula.site and org.eclipse.jubula.site.rc as my two update sites.

I updated the Jubula Functional Testing portion which updated my IDEs plugins. I then wrote a script to grab the plugins that were just updated and put them into the jubula/servers/plugins folder as well so that the headless (autexec) receives the update. I'm getting the following error when running in Jenkins now. I'll roll back to the release version and keep playing it though.

Below myHostName is my actual hostname.


..........
Thu Aug 08 12:50:03 EDT 2013	End of Test Suite
Thu Aug 08 12:50:03 EDT 2013	Writing Report into file-system
Thu Aug 08 12:50:04 EDT 2013	Writing Report to Database
Thu Aug 08 12:50:05 EDT 2013	AUT:		Disconnected.
Thu Aug 08 12:50:05 EDT 2013	Executing Test Suite "Project Creation: Component Wizard"...
Thu Aug 08 12:50:05 EDT 2013	Preparing execution of Test Suite "Project Creation: Component Wizard"...
Thu Aug 08 12:50:05 EDT 2013	AUT:		Connecting to "Jenkins_1_9"...
Thu Aug 08 12:50:06 EDT 2013	AUT:		Disconnected.
AUT:12:50:06.569 [Connection.ReaderThread:Socket[addr=myHostName/127.0.0.1,port=57327,localport=59871]] ERROR o.e.j.communication.Communicator - could not send answer 
AUT:org.eclipse.jubula.tools.exception.CommunicationException: Communicator not connected
AUT:	at org.eclipse.jubula.communication.Communicator.checkConnectionState(Communicator.java:462) ~[org.eclipse.jubula.communication.jar:na]
AUT:	at org.eclipse.jubula.communication.Communicator.send(Communicator.java:478) ~[org.eclipse.jubula.communication.jar:na]
AUT:	at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:854) ~[org.eclipse.jubula.communication.jar:na]
AUT:	at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:401) [org.eclipse.jubula.communication.jar:na]
AUT:	at org.eclipse.jubula.communication.connection.Connection.access$3(Connection.java:390) [org.eclipse.jubula.communication.jar:na]
AUT:	at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:453) [org.eclipse.jubula.communication.jar:na]
Thu Aug 08 12:50:06 EDT 2013	Resolving predefined Variables
Thu Aug 08 12:50:06 EDT 2013	Resolving Test Steps to execute...


It then just hangs there forever.
Re: Can't connect to AUT using Jenkins...occasionally [message #1086397 is a reply to message #1082501] Wed, 14 August 2013 06:51 Go to previous message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi,

I'm afraid I don't know what's going on there. I have a vague suspicion, and I'll forward it on to check whether it's that. If I get any other information, I'll pass it on.

Best regards,
Alex
Previous Topic:Trying to setup a simple html test
Next Topic:Is it possible to escape parameters/variables included in a regex?
Goto Forum:
  


Current Time: Thu Apr 25 11:59:58 GMT 2024

Powered by FUDForum. Page generated in 0.03813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top