Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Test don't launch #170

Closed
klaaspieter opened this issue Sep 19, 2013 · 36 comments
Closed

Test don't launch #170

klaaspieter opened this issue Sep 19, 2013 · 36 comments
Labels

Comments

@klaaspieter
Copy link

I'm trying to run my tests using xctool -workspace Karma.xcworkspace -scheme Karma -sdk iphonesimulator test Everything builds fine but then the run-tests phase hangs on “Launching test host and running tests…”

Log of the run test phase:

[Info] Collecting info for testables... (1113 ms)
run-test Specs.octest (iphonesimulator7.0, application-test, GC OFF)
[Info] Installing 'com.yourkarma.ios' ... (6517 ms)
[Info] Launching test host and running tests ...

The app actually launches in the simulator but then just sits there. I'm using Xcode 5 and building for iOS7.

@klaaspieter
Copy link
Author

Running the same thing with xcodebuild worked fine just now.

@jhaynie
Copy link

jhaynie commented Sep 21, 2013

i'm getting the same problem.

@hwaxxer
Copy link

hwaxxer commented Sep 23, 2013

Same problem, happens when using XCTest.

@klaaspieter
Copy link
Author

I'm using specta / expecta which is built on top of OCTest.

@yqiang
Copy link

yqiang commented Sep 23, 2013

We are running into the same issue after upgrading the Xcode 5.

command:
/usr/local/bin/xctool -workspace myproject.xcworkspace -scheme Tests -sdk iphonesimulator -reporter plain test -freshSimulator

output:

[Info] Collecting info for testables... (2557 ms)
  run-test Tests.octest (iphonesimulator7.0, application-test, GC OFF)
    [Info] Stopping any existing iOS simulator jobs to get a fresh simulator ... (159 ms)
    [Info] Installing 'com.foo.myproject-tests' ... (11937 ms)
    [Info] Launching test host and running tests ...
** TEST SUCCEEDED: 0 passed, 0 failed, 0 errored, 0 total ** (31778 ms)

@fpotter
Copy link
Contributor

fpotter commented Sep 23, 2013

Could you try running your tests again, but with Console.app open? There might be some interesting info in the logs.

@yqiang
Copy link

yqiang commented Sep 23, 2013

Gladly. Here's the output:

9/23/13 2:15:28.114 PM myproject[44293]: libMobileGestalt utility.c:477: Could not get device class
9/23/13 2:15:28.115 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0xce15dc0 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.116 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.116 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0x10397bd0 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.116 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.117 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0x10395f50 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.117 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.118 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0x10395f50 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.118 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.118 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0xce15dc0 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.119 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.119 PM myproject[44293]: libMobileGestalt MobileGestaltSupport.m:69: IPC error Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection was invalidated from the other process or the connection name was invalid.) UserInfo=0x10395f50 {NSDebugDescription=The connection was invalidated from the other process or the connection name was invalid.}
9/23/13 2:15:28.119 PM myproject[44293]: libMobileGestalt MGIOMFBSupport.c:174: failed to get static screen info
9/23/13 2:15:28.120 PM myproject[44293]: Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size
9/23/13 2:15:28.143 PM myproject[44293]: BUG in libdispatch client: kevent[EVFILT_VNODE] add: "Bad file descriptor" - 0x9
9/23/13 2:15:28.194 PM myproject[44293]: CLTilesManagerClient: initialize, sSharedTilesManagerClient
9/23/13 2:15:28.194 PM myproject[44293]: CLTilesManagerClient: init
9/23/13 2:15:28.194 PM myproject[44293]: CLTilesManagerClient: reconnecting, 0xcee93c0
9/23/13 2:15:28.194 PM myproject[44293]: CLTilesManagerClient: XPC_ERROR_CONNECTION_INVALID!
9/23/13 2:15:29.257 PM myproject[44293]: SCNetworkReachability server not available
9/23/13 2:15:29.257 PM myproject[44293]: SCNetworkReachability server not available
9/23/13 2:15:29.257 PM myproject[44293]: SCDynamicStoreCreate() failed
9/23/13 2:15:29.278 PM myproject[44293]: libMobileGestalt SimCapabilities.c:30: can't load simulator capabilities dictionary from (null)
9/23/13 2:15:29.278 PM myproject[44293]: Could not successfully update network info during initialization.

@fpotter
Copy link
Contributor

fpotter commented Sep 23, 2013

@yqiang I just tried to repro your problem, but couldn't. Can you help me out with more info?

In one of your tests, could you add ...

#ifdef __i386__
    NSLog(@"i386");
#else
    NSLog(@"x86_64");
#endif

... and then run from Xcode and tell me which one you get? otest-shim.dylib is currently i386 only, and I'm wondering if your tests are getting run as x86_64.

@hwaxxer XCTest stuff won't run until this #169 lands.

@yqiang
Copy link

yqiang commented Sep 23, 2013

@fpotter
It seems to be running them as i386. Also FWIW the tests compile and run fine under Xcode. Let me know what other information I can provide to help debug this. Thanks for your help!

@andyvb
Copy link

andyvb commented Sep 24, 2013

Seeing the same issue, simulator launches, xctest sits at "running tests...", works fine in XCode 5, iOS simulator 7. xctest seems to be hung but I can start interacting with the app in the simulator manually which xctest is hung. Mucked around with creating a new scheme, still seeing the same issue. Haven't tried a brand new project however.

@yqiang
Copy link

yqiang commented Sep 24, 2013

@fpotter I also forgot to mention that this project does use cocoapods.

@leocassarani
Copy link

Seeing exactly the same issue with xctool 0.1.12 and Xcode 5. Using CocoaPods with Specta. Console output below:

$ xctool -workspace FooBar.xcworkspace -scheme FooBar -sdk iphonesimulator run-tests ONLY_ACTIVE_ARCH=NO
[Info] Loading settings for scheme 'FooBar' ... (783 ms)

=== RUN-TESTS ===
  [Info] Collecting info for testables... (879 ms)
  run-test FooBarTests.octest (iphonesimulator7.0, application-test, GC OFF)
    [Info] Installing 'com.foo.bar' ... (3851 ms)
    [Info] Launching test host and running tests ...

xctool hangs at "Launching test host and running tests ...", and the app is launched in the simulator.

@yqiang
Copy link

yqiang commented Sep 24, 2013

@fpotter

Another bit of information to help you track down the issue. It looks like things are running smoothly once I downgraded to xctool 0.1.11. This may help everyone else on this thread as well :)

@yqiang
Copy link

yqiang commented Sep 24, 2013

@fpotter
Sorry, was too quick on that one. Using xctool 0.1.11 tests run fine against the iOS 6.1 simulator (-sdk iphonesimulator6.1). Against the iOS 7 simulator we get the following output:

** TEST SUCCEEDED: 0 of 0 tests passed ** (57484 ms)

@luisobo
Copy link

luisobo commented Sep 24, 2013

same problem here.

Xcode 5 (final)
Cocoapods
Kiwi

@blakewatters
Copy link
Contributor

An easy workaround for this if you still have Xcode 4 laying around (I have mine at /Applications/Xcode4.app) is to set your Xcode command line tools to use the 4.x and then do your development in Xcode 5. This is my current approach for development since Travis CI doesn't have Xcode 5 available yet for CI.

To change your tools path from the shell:
sudo xcode-select -switch /path/to/Xcode4.app

@luisobo
Copy link

luisobo commented Sep 25, 2013

@fpotter seems like CocoaPods is always involved. Could it be an issue related with the changes introduced in 0.7 to resolve implicit dependencies for CocoaPods?

@bpoplauschi
Copy link

I'm having a similar problem described in #173 : most of my tests are Kiwi, I only got one OCUnit class. Only the OCUnit tests are run using xctool 0.1.12 no matter if i use SDK 5 or 4. On the other hand, xctool 0.1.11 works fine on both SDK 5 and 4.

@sandervandenbrink
Copy link

xctool 0.1.12 doesn't seem to work with XCTest framework.

I get this:

[Info] Collecting info for testables... (1147 ms)
run-test Blaat2Tests.xctest (iphonesimulator7.0, logic-test, GC OFF)
** TEST SUCCEEDED: 0 passed, 0 failed, 0 errored, 0 total ** (4568 ms)

It does work when using the SenTestingKit framework. I create a new project (Cocoa Touch Static Library template) with Xcode 5, select the test target, change the wrapper extension from xctest to octest in the Build Settings and replace the linked XCTest.framework with SenTestingKit.framework in Build Phases. (Don't forget to change the tests with the SenTestingKit stuff instead of XCTest).

@dodikk
Copy link

dodikk commented Oct 3, 2013

Same problem : tests are not launched.
xCode5 final. No CocoaPods usage.

OSX-C07GR028DJD1:Dashboard dodikk$ /Users/dodikk/projects/tools/xctool/xctool.sh -workspace Dashboard.xcworkspace -scheme Dashboard test -test-sdk iphonesimulator7.0
[Info] Loading settings for scheme 'Dashboard' ... (2670 ms)

=== TEST ===

  xcodebuild build build
    DashboardTestBundles / SampleDataset ((Release))
      ✓ Check dependencies (67 ms)

    SDFavourites / SDFavourites (Coverage)
      ✓ Check dependencies (68 ms)

    ESDotnetFormatter / ESDotnetFormatter (Coverage)

    ✓ Check dependencies (68 ms)
    SCUIComponents / SDNavigationWidget (Coverage)

    ✓ Check dependencies (67 ms)
    iOSReachabilityFramework / iOSReachabilityFramework ((Release))
      ✓ Check dependencies (11 ms)

    SDHelpProvider / SDHelpProvider (Coverage)
      ✓ Check dependencies (8 ms)

    MBProgressHUD / MBProgressHUD ((Release))
      ✓ Check dependencies (4 ms)

    ESDatabaseWrapper / ESDatabaseWrapper ((Release))
      ✓ Check dependencies (6 ms)

    SDLogger / SDLogger (Coverage)
      ✓ Check dependencies (6 ms)

    JFFCache / JFFCache ((Release))
      ✓ Check dependencies (15 ms)

    SDModel / SDModel (Coverage)
      ✓ Check dependencies (10 ms)

    DDUrlBuilder / DDUrlBuilder ((Release))
      ✓ Check dependencies (4 ms)

    TouchXML / TouchXMLiOS (Coverage)
      ✓ Check dependencies (12 ms)

    TouchXmlHelper / TouchXmlHelper ((Release))

    ✓ Check dependencies (8 ms)
    SDModelSerialization / SDModelSerialization (Coverage)
      ✓ Check dependencies (115 ms)

    SDLogic / SDLogic (Coverage)
      ✓ Check dependencies (254 ms)

    SCUIComponents / SCUIComponents (Coverage)

    ✓ Check dependencies (207 ms)
    XNMaths / XNMathsIOS ((Release))

    ✓ Check dependencies (147 ms)
    SCChart / SCChart (Coverage)
      ✓ Check dependencies (623 ms)

    AmberFoundation / AmberFoundation ((Release))

    ✓ Check dependencies (41 ms)
    ObjcScopedGuard / ObjcScopedGuard (Coverage)

    ✓ Check dependencies (91 ms)
    ESLocale / ESLocale (Coverage)

    ✓ Check dependencies (383 ms)
    fmdb / FMDB ((Release))

    ✓ Check dependencies (96 ms)
    JFFSecureStorage / JFFSecureStorage ((Release))

    ✓ Check dependencies (68 ms)
    HTMLParser / HTMLParser ((Release))

    ✓ Check dependencies (49 ms)
    SDApi / SDApi (Coverage)
      ✓ Check dependencies (480 ms)

    JFFScheduler / JFFScheduler ((Release))

    ✓ Check dependencies (53 ms)
    JFFUI / JFFUI ((Release))

    ✓ Check dependencies (305 ms)
    JFFUtils / JFFUtils (Coverage)
      ✓ Check dependencies (747 ms)

    CsvToSqlite / CsvToSqlite (Coverage)

    ✓ Check dependencies (16 ms)
    JFFRestKit / JFFRestKit ((Release))

    ✓ Check dependencies (30 ms)
    JFFNetwork / JFFNetwork ((Release))

    ✓ Check dependencies (393 ms)
    JFFAsyncOpNoARC / JFFAsyncOpNoARC ((Release))

    ✓ Check dependencies (87 ms)
    SDDatabase / SDQueries (Coverage)

    ✓ Check dependencies (84 ms)
    JFFAsyncOperations / JFFAsyncOperations ((Release))

    ✓ Check dependencies (116 ms)
    SDDatabase / SDDatabase (Coverage)
      ✓ Check dependencies (487 ms)

    SCAllDashboardLibs / SCAllDashboardLibs (Coverage)

    ✓ Check dependencies (2 ms)
    Dashboard / Dashboard (Coverage)
      ✓ Check dependencies (3 ms)
      ✓ Generate Dashboard.app.dSYM (1676 ms)
      ✓ ProcessProductPackaging Entitlements.plist Dashboard.xcent (3 ms)
      ✓ CodeSign Dashboard.app (1794 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
/Users/dodikk/Library/Developer/Xcode/DerivedData/Dashboard-dqorvhgdhrgtwbadbgdusxwsanyt/Build/Products/Coverage-iphoneos/Dashboard.app: replacing existing signature
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


  [Info] Collecting info for testables... (0 ms)
** TEST SUCCEEDED: 0 passed, 0 failed, 0 errored, 0 total ** (9005 ms)

These are my test scheme settings :
1
2

Explicit "xcodebuild" does not work either (rdar://15130929)
3

@ryanrhee
Copy link
Contributor

ryanrhee commented Oct 3, 2013

@sandervandenbrink v0.1.13 has XCTest support.

@vyacheslavartemev
Copy link

Same issue here, with v0.1.13, just
[Info] Launching test host and running tests ...
which never ends, but another machine has xctool v0.1.5 installed and it works fine.

@paulyoung
Copy link

Same issue on 0.1.13

@zdavison
Copy link

zdavison commented Oct 8, 2013

Tests don't seem to run on 0.1.13 either.

@SlaunchaMan
Copy link

Kiwi tests in 0.1.13 are broken for me along these lines.

@sandervandenbrink
Copy link

With a cleanly created project the tests (XCTest) work with 0.1.13 if I don't pass certain build settings.

This works for example:
xctool -project foo.xcodeproj -scheme foo -sdk iphonesimulator7.0 clean test

But this gives an error:
xctool -project foo.xcodeproj -scheme foo -sdk iphonesimulator7.0 ONLY_ACTIVE_ARCH=NO clean test

failed: Failed to query the list of test cases in the test bundle: dyld: could not load inserted library: /usr/local/Cellar/xctool/0.1.13/libexec/lib/otest-query-ios-dylib.dylib

Not sure if this is merely due to passing a build setting but with xcodebuild it does work.

@brow
Copy link

brow commented Oct 10, 2013

Same problem as many above:

** TEST SUCCEEDED: 0 passed, 0 failed, 0 errored, 0 total ** (4312 ms)

Xcode 5.0 (5A1412)
xctool 0.1.13
CocoaPods
Specta

@fpotter
Copy link
Contributor

fpotter commented Oct 10, 2013

Sorry guys! I was out for the past couple weeks for wedding + honeymoon, and I'm picking this back up now.

Looks like it's not affecting everyone - FB's stuff is still working alright. @sandervandenbrink has found a good repro, so I'll start there.

@fpotter
Copy link
Contributor

fpotter commented Oct 11, 2013

@sandervandenbrink #200 fixes the repro case you found (re: ONLY_ACTIVE_ARCH=NO), but there might still be more to the problem.

@vyacheslavartemev, @paulyoung, @zdavison, @SlaunchaMan, @brow Have any of you seen this repro for a project on GitHub? I'm trying to find more repro cases for this.

@paulyoung
Copy link

@fpotter - I only have it in a private repo right now but could probably put something together if no one has anything public.

I believe this might as it's similar to my project, but haven't tried it.

@brow
Copy link

brow commented Oct 11, 2013

@fpotter Here's a repro.

https://github.com/brow/XctoolFailureExample

It's not affected by the fix in #200.

@fpotter
Copy link
Contributor

fpotter commented Oct 11, 2013

OK - I've identified a few specific problems that can cause tests not to launch. Let's close out this issue and open new ones to track the specific problems.

@brow Thanks for putting up that example, but it passed for me using xctool 0.1.13 :-/ See https://gist.github.com/fpotter/6939128 I need to figure out what's different between your setup and mine.

Here are the specific issues...

xctool can't run tests using Kiwi or Specta -- #202

xctool fails to query the list of test cases when building w/ ONLY_ACTIVE_ARCH=NO -- #203

xctool cannot run tests against the "iPhone Retina (4-inch 64-bit)" simulator -- #204

xctool should use the -destination argument to start the right simulator -- #205

@fpotter fpotter closed this as completed Oct 11, 2013
@brow
Copy link

brow commented Oct 14, 2013

@fpotter I actually can't get my test case to reproduce now, either. I think I may have mixed up outputs with another test case I was working on. That other test case uses Specta, so it's covered by #202.

Thanks for your work on this cluster of issues!

@arifken
Copy link

arifken commented Nov 13, 2013

Is there a separate issue now for the original issue described, where the simulator sits and hangs on

[Info] Launching test host and running tests ... 

I'm running Kiwi tests (OCTest, not XCTest) with Xcode 5.0 (also confirmed with 5.0.2).

If I re-install v0.1.11 it works fine, but in v0.1.12 it hangs on the "launching test host" line

Thanks, and let me know if I can help!

@brow
Copy link

brow commented Nov 13, 2013

@arifken There is! #245

@arifken
Copy link

arifken commented Nov 14, 2013

@brow great, thanks!

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

No branches or pull requests