Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acceptance tests may fail randomly when using Jython #42

Open
WojtekKowaluk opened this issue Apr 8, 2016 · 9 comments
Open

acceptance tests may fail randomly when using Jython #42

WojtekKowaluk opened this issue Apr 8, 2016 · 9 comments

Comments

@WojtekKowaluk
Copy link
Contributor

When running with Jython (for example by executing mvn clean verify) on Windows and Linux (for some reason this never happens on OSX!) tests may fail randomly with Agent port not received before timeout error.

@filipecduarte
Copy link

I belive this don't work because jython can get the correct value for AGENT_PATH = os.path.abspath(os.path.dirname(file)) in RemoteSwingLibrary.py. If i change this and set the full path, start to work.

My sujection
It is possible to in the import have as input the .jar path for the jython use cases?

@WojtekKowaluk
Copy link
Contributor Author

Oh, it is true. If you put RSL in Java CLASSPATH there is issue with os.path.abspath(os.path.dirname(__file__). But if you put it in JYHONPATH instead, this line work with Jython. This issue is about other problem, which is random, so you may not know it.

@filipecduarte
Copy link

Ok. I use all in the classpath, i try to use the jythonpath.
About the issue, yes i kwon and what i do is, use the process lib to start the application. After that i use application starter to catch the application. If fail, i kill the application and start again. I try 5 times, one work.

On Fri, Jul 22, 2016 at 1:24 PM, Wojtek Kowaluk <[email protected]mailto:[email protected]> wrote:

Oh, it is true. If you put RSL in Java CLASSPATH there is issue with os.path.abspath(os.path.dirname(file). But if you put it in JYHONPATH instead, this line work with Jython. This issue is about other problem, which is random, so you may not know it.

You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/42#issuecomment-234529908, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH6dFBFVHuYHTo8nB7rtY5GNQu_zfvryks5qYLZfgaJpZM4ICzws.

WojtekKowaluk added a commit that referenced this issue Aug 4, 2016
…ng application started and system exit

This seems to fix #42
@WojtekKowaluk WojtekKowaluk reopened this Aug 4, 2016
@PeerMueller
Copy link
Contributor

We are also running in this problem using robot with the standalone jar. Unfortunately, this renders the library almost useless for us and we still have to use remoteapplications.
Problems occur mainly with keyword "Application Started" while "Start Application" seems quite stable.

Is there something that can be done? Increasing the timeout does not help.

@ehhc
Copy link

ehhc commented Sep 28, 2017

Hi @PeerMueller
I had the same problem using the standalon jar. I was using the jar in combination with grade. The problem is that os.path.abspath(os.path.dirname(__file__)) doesn’t lead to the correct path for the jar file and the javaagent dosen’t work therefore (it took quiet a lot of time to figure this out..).
My workaround is a bit dirty, but works quite well: With grade I am able to figure out the path of the jar file and set it as a environment variable (“REMOTE_SWING_LIBRARY_JAR_PATH”). In my Robot file, I’m not using the RemotSwingLibrary way of starting a application but doing the following instead:

Start JNLP file
  [Arguments]  ${AppName}  ${JnlpUrl}

  Set Java Tool Options
  ${javatooloptions}=  Set Variable  -javaagent:"%{REMOTE_SWING_LIBRARY_JAR_PATH}"=127.0.0.1:${REMOTESWINGLIBRARYPORT}:DEBUG:CLOSE_SECURITY_DIALOGS
  Set Environment Variable  JAVA_TOOL_OPTIONS  ${javatooloptions}
  Start Process  javaws  ${JnlpUrl}  shell=True
  Application Started     ${AppName}  5 minutes

I hope, if somebody else runs into the same problem this might help to workaround of it. Even though I know that it isn’t a good solution but a dirty hack..

@mel-exerp
Copy link

@ehhc
how did you read ${REMOTESWINGLIBRARYPORT} ??
Also something I really don't understand Should the RemoteSwingLibrary port be equivalent to JNLP port? or they should be different??
I still have the same exception with this solution because of ports!!! they are refused to open or sometimes gets timeout!!

@ehhc
Copy link

ehhc commented Jul 29, 2019

@mel-exerp if i remeber it correctly, you can simply access it by writing %{REMOTESWINGLIBRARYPORT}. see http://robotframework.org/robotframework/2.8.7/libraries/OperatingSystem.html#Get%20Environment%20Variable for further information

@mel-exerp
Copy link

mel-exerp commented Jul 30, 2019 via email

@mel-exerp
Copy link

No unfortunately you can't it gives error!!
And it always gets error while running - even you set a specific port - connection time out, port refuse!! every time with different error!!
Although these errors are fake, port is open... so I think there is a bigger issues in this jar!

It is really not working at all, and I decide to not waste more time with it!!
But thanks for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants