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

Crash when running UI tests in parallel #208

Closed
ccornelis opened this issue Apr 11, 2024 · 5 comments
Closed

Crash when running UI tests in parallel #208

ccornelis opened this issue Apr 11, 2024 · 5 comments

Comments

@ccornelis
Copy link

When I configure my test plan to run UI tests in parallel, a crash in SBTUITestTunnelServer.m occurs.
The test plan runs fine when not running tests in parallel.
In my case Xcode runs 5 UI test simulators (clones) in parallel.

[SBTUITestTunnel] Shutting down with error: '[SBTUITestTunnelClient] Failed getting IPC proxy, Error Domain=DTXIPCErrorDomain Code=1 "Connection <DTXIPCConnection: 0x60000260c4e0> is invalid." UserInfo={NSLocalizedDescription=Connection <DTXIPCConnection: 0x60000260c4e0> is invalid.}' *** Assertion failure in -[SBTUITunneledApplication tunnelClient:didShutdownWithError:], SBTUITunneledApplication.m:57 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '[SBTUITestTunnelClient] Failed getting IPC proxy, Error Domain=DTXIPCErrorDomain Code=1 "Connection <DTXIPCConnection: 0x60000260c4e0> is invalid." UserInfo={NSLocalizedDescription=Connection <DTXIPCConnection: 0x60000260c4e0> is invalid.}' *** First throw call stack: ( 0 CoreFoundation 0x0000000180491128 __exceptionPreprocess + 172 1 libobjc.A.dylib 0x000000018008412c objc_exception_throw + 56 2 Foundation 0x0000000180d1163c _userInfoForFileAndLine + 0 3 BonsaiUITests 0x000000011a9b4c04 -[SBTUITunneledApplication tunnelClient:didShutdownWithError:] + 180 4 BonsaiUITests 0x000000011a9adf74 -[SBTUITestTunnelClient shutDownWithError:] + 220 5 BonsaiUITests 0x000000011a9adffc -[SBTUITestTunnelClient shutDownWithErrorMessage:code:] + 104 6 BonsaiUITests 0x000000011a9ae7f4 __54-[SBTUITestTunnelClient launchTunnelWithStartupBlock:]_block_invoke + 116 7 BonsaiUITests 0x000000011a9a4c70 -[_DTXIPCDistantObject forwardInvocation:] + 704 8 CoreFoundation 0x0000000180495054 ___forwarding___ + 732 9 CoreFoundation 0x000000018049759c _CF_forwarding_prep_0 + 92 10 BonsaiUITests 0x000000011a9b3d04 -[SBTUITestTunnelClient sendSynchronousRequestWithPath:params:assertOnError:] + 1652 11 BonsaiUITests 0x000000011a9af234 -[SBTUITestTunnelClient stubRequestsMatching:response:] + 244 12 BonsaiUITests 0x000000011a9b4e60 -[SBTUITunneledApplication stubRequestsMatching:response:] + 96 13 BonsaiUITests 0x000000011a94d1e8 $s13BonsaiUITests0A10UITestCaseC13stubConstants20forceAddFirstAccountySb_tF + 288 14 BonsaiUITests 0x000000011a94d250 $s13BonsaiUITests0A10UITestCaseC13stubConstants20forceAddFirstAccountySb_tFTo + 40 15 BonsaiUITests 0x000000011a93138c $s13BonsaiUITests0A10UITestCaseC5setUpyyFyycfU_ + 232 16 BonsaiUITests 0x000000011a931534 $sIeg_IeyB_TR + 28 17 BonsaiUITests 0x000000011a9aeeec __42-[SBTUITestTunnelClient serverDidConnect:]_block_invoke + 224 18 libdispatch.dylib 0x000000018016b4f4 _dispatch_call_block_and_release + 24 19 libdispatch.dylib 0x000000018016cd3c _dispatch_client_callout + 16 20 libdispatch.dylib 0x000000018017bb24 _dispatch_main_queue_drain + 1272 21 libdispatch.dylib 0x000000018017b61c _dispatch_main_queue_callback_4CF + 40 22 CoreFoundation 0x00000001803f1a30 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 23 CoreFoundation 0x00000001803ec148 __CFRunLoopRun + 1936 24 CoreFoundation 0x00000001803eb5a4 CFRunLoopRunSpecific + 572 25 XCTestCore 0x0000000105bcad48 +[XCTWaiter _synchronouslyWaitForTimeInterval:] + 112 26 XCTestCore 0x0000000105bcb2d4 -[XCTWaiter _performWait:manager:completionHandler:] + 516 27 XCTestCore 0x0000000105bc9310 -[XCTWaiter _waitForExpectations:timeout:enforceOrder:synchronously:completionHandler:] + 528 28 XCTestCore 0x0000000105bc90b0 -[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 108 29 XCTestCore 0x0000000105bc94f8 +[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 76 30 XCUIAutomation 0x000000010497d328 XCUIWaitAndLog + 128 31 XCUIAutomation 0x0000000104952954 __67-[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]_block_invoke + 216 32 XCTestCore 0x0000000105bc2c00 -[XCTContext _runActivityNamed:type:block:] + 196 33 XCTestCore 0x0000000105bc17e8 -[XCTContext runInternalActivityNamed:block:] + 124 34 XCUIAutomation 0x0000000104952848 -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:] + 212 35 XCUIAutomation 0x000000010495d780 __42-[XCUIApplicationImpl _launchWithRequest:]_block_invoke + 996 36 XCTestCore 0x0000000105bc2c00 -[XCTContext _runActivityNamed:type:block:] + 196 37 XCTestCore 0x0000000105bc17e8 -[XCTContext runInternalActivityNamed:block:] + 124 38 XCUIAutomation 0x000000010495d354 -[XCUIApplicationImpl _launchWithRequest:] + 224 39 XCTestCore 0x0000000105bc2c00 -[XCTContext _runActivityNamed:type:block:] + 196 40 XCTestCore 0x0000000105bc17e8 -[XCTContext runInternalActivityNamed:block:] + 124 41 XCUIAutomation 0x000000010495cd9c -[XCUIApplicationImpl serviceOpenRequest:] + 344 42 XCUIAutomation 0x0000000104972fcc -[XCUIApplication _launchUsingXcode:withoutAccessibility:launchURL:] + 296 43 BonsaiUITests 0x000000011a9ae570 -[SBTUITestTunnelClient launchTunnelWithStartupBlock:] + 1352 44 BonsaiUITests 0x000000011a9b4cc0 -[SBTUITunneledApplication launchTunnelWithStartupBlock:] + 72 45 BonsaiUITests 0x000000011a9b4b1c -[SBTUITunneledApplication launchTunnelWithOptions:startupBlock:] + 148 46 BonsaiUITests 0x000000011a9310d4 $s13BonsaiUITests0A10UITestCaseC5setUpyyF + 2248 47 BonsaiUITests 0x000000011a931560 $s13BonsaiUITests0A10UITestCaseC5setUpyyFTo + 28 48 BonsaiUITests 0x000000011a92d3ac $s13BonsaiUITests23OnboardingLongFlowTestsC5setUpyyFToTm + 136 49 XCTestCore 0x0000000105be086c __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.134 + 16 50 XCTestCore 0x0000000105ba4ad4 -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 160 51 XCTestCore 0x0000000105be04b0 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke_2 + 48 52 XCTestCore 0x0000000105be0420 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke + 308 53 XCTestCore 0x0000000105bc2c00 -[XCTContext _runActivityNamed:type:block:] + 196 54 XCTestCore 0x0000000105bc17e8 -[XCTContext runInternalActivityNamed:block:] + 124 55 XCTestCore 0x0000000105bc16c4 +[XCTContext runInternalActivityNamed:block:] + 96 56 XCTestCore 0x0000000105bdebb4 -[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:] + 140 57 XCTestCore 0x0000000105bde810 -[XCTestCase invokeTest] + 548 58 XCTestCore 0x0000000105be00d0 __26-[XCTestCase performTest:]_block_invoke.116 + 32 59 XCTestCore 0x0000000105ba4ad4 -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 160 60 XCTestCore 0x0000000105bdfb94 __26-[XCTestCase performTest:]_block_invoke.106 + 492 61 XCTestCore 0x0000000105bc3244 +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 172 62 XCTestCore 0x0000000105bc3144 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 100 63 XCTestCore 0x0000000105bdf640 -[XCTestCase performTest:] + 248 64 XCTestCore 0x0000000105b90a38 -[XCTest runTest] + 44 65 XCTestCore 0x0000000105bc61bc -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 64 66 XCTestCore libc++abi: terminating due to uncaught exception of type NSException

@tcamin
Copy link
Member

tcamin commented Jun 26, 2024

This might have been addressed recently in #212. If not please reopen the issue, thanks!

@tcamin tcamin closed this as completed Jun 26, 2024
@ccornelis
Copy link
Author

ccornelis commented Aug 13, 2024

I tried to run our UI tests with the latest SBUITestTunnel master, but unfortunately the issue is still there.

I don't think I can reopen the issue because I'm not a repo collaborator.

@tcamin
Copy link
Member

tcamin commented Aug 13, 2024

Did you try disabling IPC as described here?

@ccornelis
Copy link
Author

I gave it a try and with good results. No more crashes.
Thanks @tcamin for the 💯 support!

@tcamin
Copy link
Member

tcamin commented Aug 14, 2024

🙌

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

2 participants