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

Timeout while running calabash on jenkins and via SSH #251

Closed
Opalo opened this Issue Nov 22, 2013 · 12 comments

Comments

Projects
None yet
6 participants
@Opalo

Opalo commented Nov 22, 2013

Hi guys,
I have very similar problem to the already described in: #203.

What's going on:

  • running 'cucumber' locally works
  • when I connect to the server using remote desktop and run 'cucumber' everything works fine
  • when I connect to remote server via SSH and run 'cucumber' it fails with timeout
  • when I run a job on jenkins (master - slave) CI server it also fails with timeout - there's a user logged in all the time to keep the 'visual' connection

How it fails exactly (via SSH connection and with jenkins):

What I've already tried:

  • running it with sudo - no success
  • running 'sudo DevToolsSecurity -enable' - no success

How it fails:
When I start calabash console and run the server I get the following message (quite strange, to be honest)

Calabash::Cucumber::Launcher::StartError: Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop to Start. 
 Logfile /var/folders/0n/h1r75_2n2ynfc8q4y4d53y1h0000gq/T/run_loop20131122-13530-15kzx5g/run_loop.out 

 Failed to authorize rights (0x2) with status: -60007.
Failed to authorize rights (0x2) with status: -60007.
2013-11-22 11:59:53.566 ScriptAgent[13751:2e07] CLTilesManagerClient: initialize, sSharedTilesManagerClient
2013-11-22 11:59:53.566 ScriptAgent[13751:2e07] CLTilesManagerClient: init
2013-11-22 11:59:53.566 ScriptAgent[13751:2e07] CLTilesManagerClient: reconnecting, 0x9629af0
2013-11-22 11:59:53.636 ScriptAgent[13751:2e07] AXError: Could not auto-register for pid status change
2013-11-22 11:00:04 +0000 Fail: Could not start script, target application is not frontmost.

What makes me uneasy are those 'authorize' lines as well as 'Fail: Could not start script, target application is not frontmost'

Regardless how I try to run calabash tests simulator on the remote server is always started - so this isn't probably and issue with permissions.

Any ideas how it could be fixed?

@cowboygneox

This comment has been minimized.

Show comment
Hide comment
@cowboygneox

cowboygneox Nov 25, 2013

I am getting the same issue. I'll try to find time this week to dig into it more.

cowboygneox commented Nov 25, 2013

I am getting the same issue. I'll try to find time this week to dig into it more.

@Opalo

This comment has been minimized.

Show comment
Hide comment
@Opalo

Opalo Nov 25, 2013

Would be very nice :) Unfortunately I do not have enough time at the moment, but please share with the results.

In general this might be the problem with being logged in with remote desktop, but even if I'm logged in it still timeouts.

Opalo commented Nov 25, 2013

Would be very nice :) Unfortunately I do not have enough time at the moment, but please share with the results.

In general this might be the problem with being logged in with remote desktop, but even if I'm logged in it still timeouts.

@cowboygneox

This comment has been minimized.

Show comment
Hide comment
@cowboygneox

cowboygneox Nov 26, 2013

I spent the morning looking into this and have made no progress. When I run locally, I will get that timeout one time (consistently), and then my UI tests will run on the second try. On Jenkins, it will bounce back and forth between the timeout 3 times (thus resulting in a failure), and sometimes I get an alert for "ios simulator failed to install the application".

These tests used to be working fine, or were just a little flakey, but acceptable, prior to updating to Xcode 5.0.2 (5A3005).

My next idea is to try the beta iOS 7.1 that just came out and see if anything changes with that, but other than that, I could really use some direction on how to move forward. Anyone have any ideas?

cowboygneox commented Nov 26, 2013

I spent the morning looking into this and have made no progress. When I run locally, I will get that timeout one time (consistently), and then my UI tests will run on the second try. On Jenkins, it will bounce back and forth between the timeout 3 times (thus resulting in a failure), and sometimes I get an alert for "ios simulator failed to install the application".

These tests used to be working fine, or were just a little flakey, but acceptable, prior to updating to Xcode 5.0.2 (5A3005).

My next idea is to try the beta iOS 7.1 that just came out and see if anything changes with that, but other than that, I could really use some direction on how to move forward. Anyone have any ideas?

@cowboygneox

This comment has been minimized.

Show comment
Hide comment
@cowboygneox

cowboygneox Nov 26, 2013

After updating to Xcode 5.1 DP, this is my log:

cat /var/folders/94/g_1b8gms23v0fh89vw2j0c780000gn/T/run_loop20131126-24939-1s4l1jy/run_loop.out
Failed to open kernels directory (/System/Library/Kernels): No such file or directory
2013-11-26 12:57:31.108 ScriptAgent[24998:2e07] CLTilesManagerClient: initialize, sSharedTilesManagerClient
2013-11-26 12:57:31.109 ScriptAgent[24998:2e07] CLTilesManagerClient: init
2013-11-26 12:57:31.109 ScriptAgent[24998:2e07] CLTilesManagerClient: reconnecting, 0x10aa0b660
2013-11-26 12:57:31.269 ScriptAgent[24998:2e07] AXError: Could not auto-register for pid status change
2013-11-26 12:57:31.272 ScriptAgent[24998:2e07] Failed to enable accessiblity, kAXErrorServerNotFound
2013-11-26 12:57:34.566 instruments[24959:5f07] Automation Instrument ran into an exception while trying to run the script.  UIAScriptAgentSignaledException
2013-11-26 18:57:34 +0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 8.144976s; Output : /var/folders/94/g_1b8gms23v0fh89vw2j0c780000gn/T/run_loop20131126-24939-1s4l1jy/trace.trace)

cowboygneox commented Nov 26, 2013

After updating to Xcode 5.1 DP, this is my log:

cat /var/folders/94/g_1b8gms23v0fh89vw2j0c780000gn/T/run_loop20131126-24939-1s4l1jy/run_loop.out
Failed to open kernels directory (/System/Library/Kernels): No such file or directory
2013-11-26 12:57:31.108 ScriptAgent[24998:2e07] CLTilesManagerClient: initialize, sSharedTilesManagerClient
2013-11-26 12:57:31.109 ScriptAgent[24998:2e07] CLTilesManagerClient: init
2013-11-26 12:57:31.109 ScriptAgent[24998:2e07] CLTilesManagerClient: reconnecting, 0x10aa0b660
2013-11-26 12:57:31.269 ScriptAgent[24998:2e07] AXError: Could not auto-register for pid status change
2013-11-26 12:57:31.272 ScriptAgent[24998:2e07] Failed to enable accessiblity, kAXErrorServerNotFound
2013-11-26 12:57:34.566 instruments[24959:5f07] Automation Instrument ran into an exception while trying to run the script.  UIAScriptAgentSignaledException
2013-11-26 18:57:34 +0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 8.144976s; Output : /var/folders/94/g_1b8gms23v0fh89vw2j0c780000gn/T/run_loop20131126-24939-1s4l1jy/trace.trace)
@cowboygneox

This comment has been minimized.

Show comment
Hide comment
@cowboygneox

cowboygneox Nov 26, 2013

I disabled my UI tests on my Jenkins CI until further notice. I'm blocked and I have no more time to devote to the issue, at least not for a while.

cowboygneox commented Nov 26, 2013

I disabled my UI tests on my Jenkins CI until further notice. I'm blocked and I have no more time to devote to the issue, at least not for a while.

@Opalo

This comment has been minimized.

Show comment
Hide comment
@Opalo

Opalo Nov 26, 2013

Thanks for the commitment. I'm also stuck with this issue and can't run tests :/

Opalo commented Nov 26, 2013

Thanks for the commitment. I'm also stuck with this issue and can't run tests :/

@jmoody

This comment has been minimized.

Show comment
Hide comment
@jmoody

jmoody Dec 3, 2013

Member

I am going to close this issue because it does not pertain to the calabash gem.

This discussion is better suited for the forum.

I really do not like closing active, lively conversations like this one, but this is not right venue. We are investigating other forum/discussion platforms beyond the google forums.

Member

jmoody commented Dec 3, 2013

I am going to close this issue because it does not pertain to the calabash gem.

This discussion is better suited for the forum.

I really do not like closing active, lively conversations like this one, but this is not right venue. We are investigating other forum/discussion platforms beyond the google forums.

@jmoody jmoody closed this Dec 3, 2013

@Arneball

This comment has been minimized.

Show comment
Hide comment
@Arneball

Arneball commented Jan 29, 2014

http://stackoverflow.com/a/11416025/351036
Works with TeamCity and through SSH.

@Opalo

This comment has been minimized.

Show comment
Hide comment
@Opalo

Opalo Jan 29, 2014

Thanks for sharing it. Actually we've resigned from using calabash, but maybe will use this hint later.

Opalo commented Jan 29, 2014

Thanks for sharing it. Actually we've resigned from using calabash, but maybe will use this hint later.

@gsaslis

This comment has been minimized.

Show comment
Hide comment
@gsaslis

gsaslis Jun 9, 2014

The overall problem was that when running via SSH, jenkins had no way of confirming the prompts you get on an OSX (the first time after logging in)
e.g. the first time you run the simulator through calabash (that reads something like 'allow ... to take control of the simulator'..

It was quite difficult to track exactly because you only get this the first time ... and you therefore forget about it...

This issue really helped: #203
we solved this issue by:

  1. First enable your machine for development:
    DevToolsSecurity -enable
    (read this ​#203)
  2. Then add jenkins user to the _developer group:
    sudo dscl . -append /Groups/_developer GroupMembership jenkins
  3. Then give access to the developer group by
    security authorizationdb write system.privilege.taskport is-developer
    (read this again ​#203)

good luck!

gsaslis commented Jun 9, 2014

The overall problem was that when running via SSH, jenkins had no way of confirming the prompts you get on an OSX (the first time after logging in)
e.g. the first time you run the simulator through calabash (that reads something like 'allow ... to take control of the simulator'..

It was quite difficult to track exactly because you only get this the first time ... and you therefore forget about it...

This issue really helped: #203
we solved this issue by:

  1. First enable your machine for development:
    DevToolsSecurity -enable
    (read this ​#203)
  2. Then add jenkins user to the _developer group:
    sudo dscl . -append /Groups/_developer GroupMembership jenkins
  3. Then give access to the developer group by
    security authorizationdb write system.privilege.taskport is-developer
    (read this again ​#203)

good luck!

@biolinh

This comment has been minimized.

Show comment
Hide comment
@biolinh

biolinh Jul 14, 2015

Hi @gsaslis. thank you for your answer.

I did as you suggest, I bypassed the error. However, It shows another error as below

xcodebuild[12244:1007] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTiOSFrameworks/DVTiOSFrameworks-6760/DVTiPhoneSimulatorRemoteClient/DTiPhoneSimulatorSession.m:285
Details: iPhoneSimulatorSession logic error: listening for session started notification when sessionLifecycleProgress was 3
Object: <DTiPhoneSimulatorSession: 0x7fa68f2ed4b0>
Method: -_startSessionInSimulatorWithError:
Thread: <NSThread: 0x7fa688c14b40>{name = (null), num = 1}
Hints: None

biolinh commented Jul 14, 2015

Hi @gsaslis. thank you for your answer.

I did as you suggest, I bypassed the error. However, It shows another error as below

xcodebuild[12244:1007] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTiOSFrameworks/DVTiOSFrameworks-6760/DVTiPhoneSimulatorRemoteClient/DTiPhoneSimulatorSession.m:285
Details: iPhoneSimulatorSession logic error: listening for session started notification when sessionLifecycleProgress was 3
Object: <DTiPhoneSimulatorSession: 0x7fa68f2ed4b0>
Method: -_startSessionInSimulatorWithError:
Thread: <NSThread: 0x7fa688c14b40>{name = (null), num = 1}
Hints: None

@gsaslis

This comment has been minimized.

Show comment
Hide comment
@gsaslis

gsaslis Jul 14, 2015

glad that helped @biolinh !! : )

no idea though I'm afraid about this other issue... Not sure if this is related to calabash itself... (?)

gsaslis commented Jul 14, 2015

glad that helped @biolinh !! : )

no idea though I'm afraid about this other issue... Not sure if this is related to calabash itself... (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment