Subito-it / SBTUITestTunnel

Enable network mocks and more in UI Tests
Other
340 stars 76 forks source link

'connection went invalid while waiting for a reply because a mach port died' error #198

Closed johnmalatras closed 4 months ago

johnmalatras commented 8 months ago

Hi, Xcode 15.0.1 has finally fixed the issues with UI test timeouts, but I'm now running into a new issue originating in SBTUITestTunnel. Intermittently I receive the following crash on tests:

2023-11-02 12:51:51.780136-0400 SubstackUITests-Runner[59622:1113889] [SBTUITestTunnel] IPC tunnel did connect after, 5.125292s
2023-11-02 12:51:51.800965-0400 SubstackUITests-Runner[59622:1113889] [SBTUITestTunnel] Did perform startupBlock
2023-11-02 12:51:52.617679-0400 SubstackUITests-Runner[59622:1113889] *** Terminating app due to uncaught exception 'NSInvalidReceivePortException', reason: 'connection went invalid while waiting for a reply because a mach port died'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000018048d8a8 __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x000000018008409c objc_exception_throw + 56
    2   Foundation                          0x0000000180cf99d8 -[NSConnection sendInvocation:internal:] + 2032
    3   CoreFoundation                      0x00000001804917d4 ___forwarding___ + 732
    4   CoreFoundation                      0x0000000180493d1c _CF_forwarding_prep_0 + 92
    5   Foundation                          0x0000000180cf69c0 -[NSConnection rootProxy] + 52
    6   SubstackUITests                     0x000000010711c800 -[_DTXIPCDistantObject forwardInvocation:] + 1132
    7   CoreFoundation                      0x00000001804917d4 ___forwarding___ + 732
    8   CoreFoundation                      0x0000000180493d1c _CF_forwarding_prep_0 + 92
    9   S

This appears to be a different crash than https://github.com/Subito-it/SBTUITestTunnel/issues/179

tcamin commented 6 months ago

This generally occurs when running too many ui testing simulators in parallel. UITesting failures are to be expected so you should ensure to have some sort of retry logic in place.