Closed ewanmellor closed 9 years ago
This may be the same issue as #367, but since that issue is so old, and on Xcode 5.1, I figured opening a new issue would be best.
See #450 for the same test suite, but discussing the other failures.
Thanks for the repro! Will try to take a look in the next week.
I'm having similar problems using SCNetworkReachability. When the tests start to run, I see the following output:
Dec 17 22:01:46 david.foscomputerservices.com xctest[79852] <Error>: DNS configuration server not available
Dec 17 22:01:46 david.foscomputerservices.com xctest[79852] <Error>: com.apple.SystemConfiguration.DNSConfiguration_sim: server not available nwi_state: registration failed (1000000)
Dec 17 22:02:21 david.foscomputerservices.com xctest[79852] <Error>: com.apple.SystemConfiguration.NetworkInformation_sim: server not available
Dec 17 22:02:21 david.foscomputerservices.com xctest[79852] <Error>: Network information server not available
Dec 17 22:02:21 david.foscomputerservices.com xctest[79852] <Debug>: Reachability Flag Status: -- ------- networkStatusForFlags
The output of the Reachability Flag Status is mine, but the rest are from somewhere not in my code (iOS internals maybe?).
I have no problems running these in XCode or via xcodebuild.
So I did a bit more digging on this and I verified that the above error output is coming from the call to SCNetworkReachabilityGetFlags().
So, I decided to just turn off the reachability code and see what would happen then. It seems that I'm simply just not able to access the network at all when running under xctool:
2014-12-19 17:26:02.344 xctest[1477:9076207] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807)
Dec 19 17:26:02 david.foscomputerservices.com xctest[1477] <Error>: FOSWebService ERROR -- Message: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.parse.com” which could put your confidential information at risk." UserInfo=0x7b02f280 {NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.parse.com” which could put your confidential information at risk., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9807, NSErrorFailingURLStringKey=https://api.parse.com/1/events/AppOpened, _kCFStreamErrorDomainKey=3, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7b03bc70>, NSUnderlyingError=0x7b4dfa00 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.parse.com” which could put your confidential information at risk.", NSErrorFailingURLKey=https://api.parse.com/1/events/AppOpened}
Again, I have no problems running these tests in Xcode or xcodebuild.
Likewise, I'm having similar issues with my tests that include network activity. Any clarity into where the issue would be, perhaps we can solve this ourselves?
This is fixed since we switched to simctl
to run logic tests. Your test isn't failing since commit 6b59d2005b5edd24582aceb2601b698dae980736.
I have a test that first checks if
gmail.com
is reachable on the network, usingSCNetworkReachability*
fromSystemConfiguration
. This fails under xctool, but passes under xcodebuild.The logging is below. Note the "registration failed" message, and that the test took 35 seconds (a timeout, presumably). Under xcodebuild this test passes in 0.045 seconds.