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

Add timeout on "xcodebuild -list", if XCode version 6 #58

Merged
merged 1 commit into from Feb 12, 2015
Merged

Add timeout on "xcodebuild -list", if XCode version 6 #58

merged 1 commit into from Feb 12, 2015

Conversation

@raphaelquati
Copy link

@raphaelquati raphaelquati commented Feb 9, 2015

No description provided.

@lacostej
Copy link
Member

@lacostej lacostej commented Feb 9, 2015

Hei Raphael, I can't review the commit as the formatting was modified heavily. Could you please try again and check spacing / line endings configurations ? Feel free to push force on that branch to check it again.

If you have problem, I'll try to deal with it when merging manually.

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 9, 2015

Sorry about that. Windows + Eclipse issues..... :)

@jenkinsadmin
Copy link
Member

@jenkinsadmin jenkinsadmin commented Feb 9, 2015

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 9, 2015

Fixed line endings.

@lacostej
Copy link
Member

@lacostej lacostej commented Feb 9, 2015

Sorry to be an ass... Can you squash those so that I can review from the github interface ?

Thanks :)

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 10, 2015

No problem. :)

Squash done.

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 10, 2015

I think it's better to put a default timeout , instead of parse xcode version.

I don't know the reason of hang in xcode 6, but I think Apple will keep this behaviour.

I've tried to discover the problem, using dtruss (like strace) (https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtruss.1m.html). it expects (i guess) the Xcode is running. If you ran xcodebuild -list with xcode opened, it shows more activity (in dtruss).

Another options, is to put an option at plugin to not run " xcodebuild -list ".

@lacostej
Copy link
Member

@lacostej lacostej commented Feb 10, 2015

Raphael, what about the try/catch/finally ? is it really needed ? Was it to ensure that returnCode would be 0 ? Have you checked the joinWithTimeout was returning when invoking the hanging xocdebuild -list command ?

I am trying to get the code as simple as possible.

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 11, 2015

My first test, after calls to "joinWithTimeout", the build is marked as failure. Always (maybe the TaskListener?)

joinWithTimeout always returns (timeout), build always marked as fail, with no Exception.

I've use try/catch block, to try to avoid this behavior. No results. So. I changed from try/catch to try/finally, to mark returnCode = 0. But the try/finally block cannot know between an real error and a timeout. This is not good.

To keep the code to simple.
I can make a "fix if" with value of 143 (timeout)? LIke this:

if (resultCode > 0 && resultCode != 143) return false;

@raphaelquati
Copy link
Author

@raphaelquati raphaelquati commented Feb 11, 2015

I'd reviewed my code. It was wrong.
I think the code is simple now. Using a default timeout to any version of xcode.

lacostej added a commit that referenced this issue Feb 12, 2015
Add timeout on "xcodebuild -list", if XCode version 6
@lacostej lacostej merged commit 73d40c2 into jenkinsci:master Feb 12, 2015
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants