wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.2k stars 1.92k forks source link

Signal 6 was raised - After upgrading from Detox 17.X to 19.1 #3266

Closed rajathrao closed 2 years ago

rajathrao commented 2 years ago

What happened?

Detox tests were running fine locally on debug version of the ios.sim. But, after upgrade to 19.1 I get the following error -

Test suite failed to run now past the splash screen . It loads for a bit and crashes.

DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

The app has crashed, see the details below:
    Signal 6 was raised
    (
        0   Detox                               0x0000000110498915 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x000000011049b370 __DTXHandleCrash + 464
        2   Detox                               0x000000011049bab1 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x00007fff522fcd7d _sigtramp + 29
        4   Edge                                0x0000000105afe000 appcenter_library_info + 709436
        5   libsystem_c.dylib                   0x00007fff521e9b7c abort + 120
        6   Edge                                0x0000000104cc2bf5 -[MSPLCrashReporter generateLiveReportWithThread:] + 0
        7   CoreFoundation                      0x00007fff23e3e2cd __handleUncaughtException + 877
        8   libobjc.A.dylib                     0x00007fff512a1c05 _objc_terminate() + 90
        9   Edge                                0x0000000102cbfd84 FIRCLSTerminateHandler() + 452
        10  Edge                                0x0000000104ca3994 MSCrashesUncaughtCXXTerminateHandler() + 780
        11  Detox                               0x000000011049bfa6 __dtx_terminate() + 157
        12  libc++abi.dylib                     0x00007fff500eec87 std::__terminate(void (*)()) + 8
        13  libc++abi.dylib                     0x00007fff500eec29 std::terminate() + 41
        14  libdispatch.dylib                   0x00007fff520dc8df _dispatch_client_callout + 28
        15  libdispatch.dylib                   0x00007fff520dec36 _dispatch_continuation_pop + 440
        16  libdispatch.dylib                   0x00007fff520efa96 _dispatch_source_invoke + 1997
        17  libdispatch.dylib                   0x00007fff520e8b7c _dispatch_main_queue_callback_4CF + 691
        18  CoreFoundation                      0x00007fff23da1869 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
        19  CoreFoundation                      0x00007fff23d9c3b9 __CFRunLoopRun + 2041
        20  CoreFoundation                      0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
        21  Foundation                          0x00007fff25967c71 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 211
        22  Foundation                          0x00007fff25967ee0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72
        23  Edge                                0x0000000104c33f8c +[RNSplashScreen show] + 316
        24  Edge                                0x0000000102680532 -[AppDelegate application:didFinishLaunchingWithOptions:] + 1106
        25  Detox                               0x0000000110497d24 -[DetoxAppDelegateProxy application:didFinishLaunchingWithOptions:] + 170
        26  UIKitCore                           0x00007fff49369610 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
        27  UIKitCore                           0x00007fff4936afaf -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3985
        28  UIKitCore                           0x00007fff49370b71 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1226
        29  UIKitCore                           0x00007fff48a7912d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
        30  UIKitCore                           0x00007fff48f84b61 _UIScenePerformActionsWithLifecycleActionMask + 83
        31  UIKitCore                           0x00007fff48a79c3f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
        32  UIKitCore                           0x00007fff48a7964e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
        33  UIKitCore                           0x00007fff48a79a6c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
        34  UIKitCore                           0x00007fff48a79301 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
        35  UIKitCore                           0x00007fff48a7d8f2 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
        36  UIKitCore                           0x00007fff48e9ac4d +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 852
        37  UIKitCore                           0x00007fff48fa32be _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
        38  UIKitCore                           0x00007fff48a7d60d __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
        39  UIKitCore                           0x00007fff48fa31c1 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
        40  UIKitCore                           0x00007fff48a7d47b -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
        41  UIKitCore                           0x00007fff488d1e78 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
        42  UIKitCore                           0x00007fff488d0a37 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253
        43  UIKitCore                           0x00007fff488d1ba2 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
        44  UIKitCore                           0x00007fff4936f0b9 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 512
        45  UIKitCore                           0x00007fff48ec177c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
        46  FrontBoardServices                  0x00007fff36d03d2e -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 419
        47  FrontBoardServices                  0x00007fff36d29dc1 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
        48  FrontBoardServices                  0x00007fff36d0e757 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
        49  FrontBoardServices                  0x00007fff36d29a52 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
        50  libdispatch.dylib                   0x00007fff520dc8cb _dispatch_client_callout + 8
        51  libdispatch.dylib                   0x00007fff520df292 _dispatch_block_invoke_direct + 285
        52  FrontBoardServices                  0x00007fff36d4f6e9 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
        53  FrontBoardServices                  0x00007fff36d4f3d7 -[FBSSerialQueue _queue_performNextIfPossible] + 441
        54  FrontBoardServices                  0x00007fff36d4f8e6 -[FBSSerialQueue _performNextFromRunLoopSource] + 22
        55  CoreFoundation                      0x00007fff23da1c91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        56  CoreFoundation                      0x00007fff23da1bbc __CFRunLoopDoSource0 + 76
        57  CoreFoundation                      0x00007fff23da1394 __CFRunLoopDoSources0 + 180
        58  CoreFoundation                      0x00007fff23d9bf8e __CFRunLoopRun + 974
        59  CoreFoundation                      0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
        60  GraphicsServices                    0x00007fff38c05bbe GSEventRunModal + 139
        61  DetoxSync                           0x000000011351fa52 __detox_sync_UIApplication_run + 362
        62  UIKitCore                           0x00007fff49372964 UIApplicationMain + 1605
        63  Edge                                0x00000001026827c4 main + 132
        64  libdyld.dylib                       0x00007fff5211c1fd start + 1
        65  ???                                 0x0000000000000010 0x0 + 16
    )

      31 |   async initDetox() {
      32 |     const instance = await this.detox.init(this.config, { launchApp: false });
    > 33 |     await instance.device.launchApp({
         |                           ^
      34 |       delete: true,
      35 |       permissions: devicePermissions,
      36 |       launchArgs: defaultLaunchArgs,

      at CustomDetoxEnvironment.initDetox (environment.js:33:27)
      at ../node_modules/detox/runners/jest-circus/environment.js:122:18
      at CustomDetoxEnvironment._onSetup (../node_modules/detox/runners/jest-circus/environment.js:119:15)
      at CustomDetoxEnvironment.handleTestEvent (../node_modules/detox/runners/jest-circus/environment.js:83:9)
      at CustomDetoxEnvironment.handleTestEvent (environment.js:63:5)

17:34:53.552 detox[48528] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 --bail e2e/e2eTests/Flows/Cards.spec.js

What was the expected behaviour?

The tests should pass

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 19.1 React Native version: 0.64 Node version: Device model: iOS version: 14.5, 13.7 macOS version: Xcode version: 12.5, 13.1 Test-runner (select one): jest-circus

Detox logs

Detox logs ``` paste logs here! ``` 17:31:36.215 detox[48528] INFO: [test.js] DETOX_CONFIGURATION="ios.sim.debug.e2e" DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1647477096191 DETOX_TAKE_SCREENSHOTS="failing" DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 --bail e2e/e2eTests/denseFlows/denseEducationCards.spec.js 17:31:41.606 detox[48529] DEBUG: [WSS_CREATE] Detox server listening on localhost:59613... 17:31:41.644 detox[48529] DEBUG: [WSS_CONNECTION, #59614] registered a new connection. 17:31:42.147 detox[48529] DEBUG: [EXEC_CMD, #0] applesimutils --list --byOS "iOS 13.7" --byType "iPhone 11" 17:31:43.693 detox[48529] DEBUG: [EXEC_CMD, #1] applesimutils --list --byId 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 --maxResults 1 17:31:44.816 detox[48529] DEBUG: [EXEC_CMD, #2] /usr/bin/xcrun simctl terminate 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:31:44.817 detox[48529] DEBUG: [EXEC_TRY, #2] Terminating to.hover.ios.dev... 17:31:45.707 detox[48529] DEBUG: [EXEC_SUCCESS, #2] to.hover.ios.dev terminated 17:31:45.713 detox[48529] DEBUG: [EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:31:45.713 detox[48529] DEBUG: [EXEC_TRY, #3] Uninstalling to.hover.ios.dev... 17:31:47.627 detox[48529] DEBUG: [EXEC_SUCCESS, #3] to.hover.ios.dev uninstalled 17:31:47.630 detox[48529] DEBUG: [EXEC_CMD, #4] /usr/bin/xcrun simctl install 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 "/Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app" 17:31:47.631 detox[48529] DEBUG: [EXEC_TRY, #4] Installing /Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app... 17:31:51.509 detox[48529] DEBUG: [EXEC_SUCCESS, #4] /Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app installed 17:31:51.516 detox[48529] DEBUG: [EXEC_CMD, #5] /usr/bin/xcrun simctl terminate 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:31:51.517 detox[48529] DEBUG: [EXEC_TRY, #5] Terminating to.hover.ios.dev... 17:31:52.348 detox[48529] DEBUG: [EXEC_SUCCESS, #5] to.hover.ios.dev terminated 17:31:52.350 detox[48529] DEBUG: [EXEC_CMD, #6] /usr/bin/xcrun simctl uninstall 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:31:52.350 detox[48529] DEBUG: [EXEC_TRY, #6] Uninstalling to.hover.ios.dev... 17:31:54.260 detox[48529] DEBUG: [EXEC_SUCCESS, #6] to.hover.ios.dev uninstalled 17:31:54.262 detox[48529] DEBUG: [EXEC_CMD, #7] /usr/bin/xcrun simctl install 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 "/Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app" 17:31:54.262 detox[48529] DEBUG: [EXEC_TRY, #7] Installing /Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app... 17:31:58.257 detox[48529] DEBUG: [EXEC_SUCCESS, #7] /Users/rajathrao/rnHover/mobile-react-native/ios/build/Build/Products/Debug-iphonesimulator/Edge.app installed 17:31:58.260 detox[48529] DEBUG: [EXEC_CMD, #8] applesimutils --byId 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 --bundle to.hover.ios.dev --restartSB --setPermissions notifications=YES,location=always,camera=YES,photos=YES 17:31:58.260 detox[48529] DEBUG: [EXEC_TRY, #8] Trying to set permissions... 17:32:02.918 detox[48529] DEBUG: [EXEC_SUCCESS, #8] Permissions are set 17:32:02.922 detox[48529] DEBUG: [EXEC_CMD, #9] SIMCTL_CHILD_GULGeneratedClassDisposeDisabled=YES SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/rajathrao/Library/Detox/ios/fee997ef6fc4658c8aa8eb742d05b92983da34a7/Detox.framework/Detox" /usr/bin/xcrun simctl launch 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev --args -detoxServer ws://localhost:59613 -detoxSessionId ff95e6bc-de9b-054f-c370-e160d7b47d6e -mockedTreatments default -apiServerPort 7172 -uploadServerPort 8091 -detoxDebugVisibility YES -detoxDisableHierarchyDump YES 17:32:02.923 detox[48529] DEBUG: [EXEC_TRY, #9] Launching to.hover.ios.dev... 17:32:10.098 detox[48529] DEBUG: [EXEC_CMD, #10] /usr/bin/xcrun simctl get_app_container 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:32:13.913 detox[48529] INFO: [AppleSimUtils.js] to.hover.ios.dev launched. To watch simulator logs, run: /usr/bin/xcrun simctl spawn 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 log stream --level debug --style compact --predicate 'process == "Edge"' 17:32:14.525 detox[48529] DEBUG: [WSS_CONNECTION, #59631] registered a new connection. 17:32:25.624 detox[48529] DEBUG: [APP_STATUS] Failed to execute the current status query. 17:34:41.891 detox[48529] DEBUG: [EXEC_CMD, #11] /usr/bin/xcrun simctl terminate 6BB01B02-F14A-4A08-AC5F-6B4F195408F6 to.hover.ios.dev 17:34:41.891 detox[48529] DEBUG: [EXEC_TRY, #11] Terminating to.hover.ios.dev... 17:34:43.061 detox[48529] DEBUG: [EXEC_SUCCESS, #11] to.hover.ios.dev terminated 17:34:48.044 detox[48529] ERROR: The pending request #-1000 ("isReady") has been rejected due to the following error: The app has crashed, see the details below: Signal 6 was raised ( 0 Detox 0x0000000110498915 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37 1 Detox 0x000000011049b370 __DTXHandleCrash + 464 2 Detox 0x000000011049bab1 __DTXHandleSignal + 59 3 libsystem_platform.dylib 0x00007fff522fcd7d _sigtramp + 29 4 Edge 0x0000000105afe000 appcenter_library_info + 709436 5 libsystem_c.dylib 0x00007fff521e9b7c abort + 120 6 Edge 0x0000000104cc2bf5 -[MSPLCrashReporter generateLiveReportWithThread:] + 0 7 CoreFoundation 0x00007fff23e3e2cd __handleUncaughtException + 877 8 libobjc.A.dylib 0x00007fff512a1c05 _objc_terminate() + 90 9 Edge 0x0000000102cbfd84 FIRCLSTerminateHandler() + 452 10 Edge 0x0000000104ca3994 MSCrashesUncaughtCXXTerminateHandler() + 780 11 Detox 0x000000011049bfa6 __dtx_terminate() + 157 12 libc++abi.dylib 0x00007fff500eec87 std::__terminate(void (*)()) + 8 13 libc++abi.dylib 0x00007fff500eec29 std::terminate() + 41 14 libdispatch.dylib 0x00007fff520dc8df _dispatch_client_callout + 28 15 libdispatch.dylib 0x00007fff520dec36 _dispatch_continuation_pop + 440 16 libdispatch.dylib 0x00007fff520efa96 _dispatch_source_invoke + 1997 17 libdispatch.dylib 0x00007fff520e8b7c _dispatch_main_queue_callback_4CF + 691 18 CoreFoundation 0x00007fff23da1869 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 19 CoreFoundation 0x00007fff23d9c3b9 __CFRunLoopRun + 2041 20 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404 21 Foundation 0x00007fff25967c71 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 211 22 Foundation 0x00007fff25967ee0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72 23 Edge 0x0000000104c33f8c +[RNSplashScreen show] + 316 24 Edge 0x0000000102680532 -[AppDelegate application:didFinishLaunchingWithOptions:] + 1106 25 Detox 0x0000000110497d24 -[DetoxAppDelegateProxy application:didFinishLaunchingWithOptions:] + 170 26 UIKitCore 0x00007fff49369610 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232 27 UIKitCore 0x00007fff4936afaf -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3985 28 UIKitCore 0x00007fff49370b71 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1226 29 UIKitCore 0x00007fff48a7912d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122 30 UIKitCore 0x00007fff48f84b61 _UIScenePerformActionsWithLifecycleActionMask + 83 31 UIKitCore 0x00007fff48a79c3f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198 32 UIKitCore 0x00007fff48a7964e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296 33 UIKitCore 0x00007fff48a79a6c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818 34 UIKitCore 0x00007fff48a79301 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345 35 UIKitCore 0x00007fff48a7d8f2 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178 36 UIKitCore 0x00007fff48e9ac4d +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 852 37 UIKitCore 0x00007fff48fa32be _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240 38 UIKitCore 0x00007fff48a7d60d __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153 39 UIKitCore 0x00007fff48fa31c1 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84 40 UIKitCore 0x00007fff48a7d47b -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381 41 UIKitCore 0x00007fff488d1e78 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657 42 UIKitCore 0x00007fff488d0a37 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253 43 UIKitCore 0x00007fff488d1ba2 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210 44 UIKitCore 0x00007fff4936f0b9 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 512 45 UIKitCore 0x00007fff48ec177c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361 46 FrontBoardServices 0x00007fff36d03d2e -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 419 47 FrontBoardServices 0x00007fff36d29dc1 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102 48 FrontBoardServices 0x00007fff36d0e757 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220 49 FrontBoardServices 0x00007fff36d29a52 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355 50 libdispatch.dylib 0x00007fff520dc8cb _dispatch_client_callout + 8 51 libdispatch.dylib 0x00007fff520df292 _dispatch_block_invoke_direct + 285 52 FrontBoardServices 0x00007fff36d4f6e9 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 53 FrontBoardServices 0x00007fff36d4f3d7 -[FBSSerialQueue _queue_performNextIfPossible] + 441 54 FrontBoardServices 0x00007fff36d4f8e6 -[FBSSerialQueue _performNextFromRunLoopSource] + 22 55 CoreFoundation 0x00007fff23da1c91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 56 CoreFoundation 0x00007fff23da1bbc __CFRunLoopDoSource0 + 76 57 CoreFoundation 0x00007fff23da1394 __CFRunLoopDoSources0 + 180 58 CoreFoundation 0x00007fff23d9bf8e __CFRunLoopRun + 974 59 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404 60 GraphicsServices 0x00007fff38c05bbe GSEventRunModal + 139 61 DetoxSync 0x000000011351fa52 __detox_sync_UIApplication_run + 362 62 UIKitCore 0x00007fff49372964 UIApplicationMain + 1605 63 Edge 0x00000001026827c4 main + 132 64 libdyld.dylib 0x00007fff5211c1fd start + 1 65 ??? 0x0000000000000010 0x0 + 16 ) 17:34:53.367 detox[48529] INFO: Scenario: Flow is assigned to undefined 17:34:53.371 detox[48529] INFO: Scenario: should allow users to log in 17:34:53.373 detox[48529] INFO: Scenario: should allow users to log in [FAIL] 17:34:53.377 detox[48529] INFO: Scenario::shall swipe through the cards 17:34:53.378 detox[48529] INFO: Scenario: : shall swipe through the cards [FAIL]

Device logs

Device logs ``` paste logs here! ``` NA

More data, please!

No response

kbgar24 commented 2 years ago

For additional context:

wangghon commented 2 years ago

We are in a similar situation as @kbgar24 when we run e2e test on iOS 14.5 simulator.

We found the app doesn't take any responses of any network requests (not wait for the promises to be resolved?) when it is being launched by detox (SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="..../Detox" usr/bin/xcrun simctl launch ...).

The issue was introduced after 18.0.0-next.1, it can be reproduced on 18.0.0-next.3. https://github.com/wix/Detox/compare/18.0.0-next.1...18.0.0-next.3

OS version: Monterrey 12.3 Xcode version: 13.3 iOS SDK: 15.4 iOS Simulator: 14.5 or 15.4 react native version: 0.64.2(same as 0.66.4) Detox: 19.5.7

rajathrao commented 2 years ago

We are in a similar situation as @kbgar24 when we run e2e test on iOS 14.5 simulator.

We found the app doesn't take any responses of any network requests (not wait for the promises to be resolved?) when it is being launched by detox (SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="..../Detox" usr/bin/xcrun simctl launch ...).

The issue was introduced after 18.0.0-next.1, it can be reproduced on 18.0.0-next.3. 18.0.0-next.1...18.0.0-next.3

OS version: Monterrey 12.3 Xcode version: 13.3 iOS SDK: 15.4 iOS Simulator: 14.5 or 15.4 react native version: 0.64.2(same as 0.66.4) Detox: 19.5.7

I am curious if you are using debug/release variant ! I am beginning to think this is def a bug !! Detox is really hard sometimes . I often wonder if solutions like Appium would make our life easier.

rajathrao commented 2 years ago

@asafkorem can someone help us here ? or point in the right direction ?

wangghon commented 2 years ago

@rajathrao We use release build to run e2e test. Actually, we experienced the same issue as you, it happens randomly. I didn't find a way to reproduce it.

rajathrao commented 2 years ago

@rajathrao We use release build to run e2e test. Actually, we experienced the same issue as you, it happens randomly. I didn't find a way to reproduce it.

weird, our release version seems to work on 19.1 but the debug version crashes

wangghon commented 2 years ago

Another way I am thinking is maybe that we haven't utilised the latest configuration, like detoxEnableSychromization.

I tried the below way, still no luck.

beforeAll(async () => { await detox.init(detoxConfig, {}); await device.launchApp({newInstance: true, launchArgs: { detoxEnableSynchronization: 1 }, permissions: {camera: 'YES', notifications: 'YES'}}); // await device.enableSynchronization(); });

asafkorem commented 2 years ago

@rajathrao You seem to be using Firebase (I guess through React Native Firebase). What Firebase version and dependencies (Performance, Crashlytics,..) do you use? (please try to upgrade to the latest)

wangghon commented 2 years ago

@rajathrao @asafkorem I can reproduce the signal 6 crash in our test.

The app crashed when trying to scroll to the bottom

Mac OS: 12.3 Xcode 13.3 iOS SDK: 15.4 iOS Simulator: iPhone 13 (15.4) react-native:064.2 detox: 17.14.9 react-native-firebase: 14.5.0

`detox[44523] TRACE: [Artifact.js/STOP] stopping SimulatorScreenshot detox[44523] DEBUG: [exec.js/EXEC_CMD, #14] applesimutils --byId F9826F9A-022C-403B-A1C7-BD1C02E895A5 --biometricEnrollment NO detox[44523] DEBUG: [exec.js/EXEC_TRY, #14] Turning off biometric enrollment... detox[44523] ERROR: [exec.js/SPAWN_STDERR, #13] Recording started

detox[44523] TRACE: [exec.js/EXEC_SUCCESS, #14] detox[44523] DEBUG: [exec.js/EXEC_SUCCESS, #14] Deactivated! detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"type":"action","action":"scrollTo","params":["bottom"],"predicate":{"type":"id","value":"scroll-whats-new"}},"messageId":2} detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=testee action=AppWillTerminateWithError (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"messageId":-10000,"type":"AppWillTerminateWithError","params":{"errorDetails":"Exception was thrown: \nNSInvalidArgumentException\n+[UIWindowScene _keyWindowScene]: unrecognized selector sent to class 0x1296ba3d8\n(\n\t0 CoreFoundation 0x00000001106f2d34 exceptionPreprocess + 226\n\t1 libobjc.A.dylib 0x000000010ccd0a65 objc_exception_throw + 48\n\t2 CoreFoundation 0x0000000110701c13 CFExceptionProem + 0\n\t3 CoreFoundation 0x00000001106f72ff forwarding + 1471\n\t4 CoreFoundation 0x00000001106f9488 _CF_forwarding_prep_0 + 120\n\t5 Detox 0x000000010cefc30d +[UIWindow(DetoxUtils) dtx_allKeyWindowSceneWindows] + 76\n\t6 Detox 0x000000010cefee83 +[UIView(DetoxMatchers) dtx_findViewsInKeySceneWindowsPassingPredicate:] + 56\n\t7 Detox 0x000000010cf17803 Detox.Element.(views in _14E24C92C1353FEA1FC68E698CB917EF).getter : Swift.Array<__C.NSObject> + 211\n\t8 Detox 0x000000010cf17b04 Detox.Element.(view in _14E24C92C1353FEA1FC68E698CB917EF).getter : C.NSObject + 52\n\t9 Detox 0x000000010cf181f0 Detox.Element.(extractScrollView in _14E24C92C1353FEA1FC68E698CB917EF)() -> __C.UIScrollView + 32\n\t10 Detox 0x000000010cf0c5a9 Detox.ScrollToEdgeAction.perform(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> + 409\n\t11 Detox 0x000000010cf0c649 vtable thunk for Detox.Action.(perform in _04ABBB5C7C570871DB67625EF38728EC)(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> dispatching to Detox.ScrollToEdgeAction.perform(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> + 9\n\t12 Detox 0x000000010cf0a3ef Detox.Action.(perform in _04ABBB5C7C570871DB67625EF38728EC)(on: Detox.Element, completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 31\n\t13 Detox 0x000000010cf0e94a partial apply forwarder for closure #1 () -> () in Detox.Action.perform(completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 42\n\t14 Detox 0x000000010cf0e991 partial apply forwarder for reabstraction thunk helper from @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> () + 17\n\t15 Detox 0x000000010cf0bebe reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @calleeunowned @convention(block) () -> () + 14\n\t16 Detox 0x000000010cf03b2e +[DTXAssertionHandler try:error:] + 47\n\t17 Detox 0x000000010cf0a4fe Detox.Action.perform(completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 238\n\t18 Detox 0x000000010cf166a4 function signature specialization <Arg[1] = Dead, Arg[2] = Owned To Guaranteed, Arg[3] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : closure #1 (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> () in closure #2 () -> () in Detox.DetoxManager.webSocket(: Detox.WebSocket, didReceiveAction: Swift.String, params: Swift.Dictionary<Swift.String, Any>, messageId: C.NSNumber) -> (), Argument Types : [Detox.DetoxManagerC.NSNumber]> of static Detox.InvocationManager.invoke(dictionaryRepresentation: Swift.Dictionary<Swift.String, Any>, completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 980\n\t19 Detox 0x000000010cf2f010 partial apply forwarder for closure #2 () -> () in Detox.DetoxManager.webSocket(_: Detox.WebSocket, didReceiveAction: Swift.String, params: Swift.Dictionary<Swift.String, Any>, messageId: C.NSNumber) -> () + 64\n\t20 Detox 0x000000010cf0bebe reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () + 14\n\t21 EarlGrey 0x000000013602058d 59-[GREYUIThreadExecutor executeSyncWithTimeout:block:error:]_block_invoke + 109\n\t22 EarlGrey 0x0000000135fd1008 __54-[GREYRunLoopSpinner grey_checkConditionInActiveMode:]_block_invoke + 472\n\t23 CoreFoundation 0x000000011065f5c9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n\t24 CoreFoundation 0x000000011065e9c7 CFRunLoopDoBlocks + 443\n\t25 CoreFoundation 0x00000001106592e2 CFRunLoopRun + 853\n\t26 CoreFoundation 0x0000000110658a90 CFRunLoopRunSpecific + 562\n\t27 EarlGrey 0x0000000135fd0cfd -[GREYRunLoopSpinner grey_checkConditionInActiveMode:] + 381\n\t28 EarlGrey 0x0000000135fcf962 -[GREYRunLoopSpinner spinWithStopConditionBlock:] + 434\n\t29 EarlGrey 0x000000013601fcb8 -[GREYUIThreadExecutor executeSyncWithTimeout:block:error:] + 1384\n\t30 EarlGrey 0x000000013601f70c -[GREYUIThreadExecutor executeSync:error:] + 364\n\t31 Detox 0x000000010cee5317 __45-[EarlGreyImpl(Detox) detox_safeExecuteSync:]_block_invoke + 134\n\t32 CoreFoundation 0x000000011065f5c9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n\t33 CoreFoundation 0x000000011065e9c7 CFRunLoopDoBlocks + 443\n\t34 CoreFoundation 0x00000001106599b4 __CFRunLoopRun + 2599\n\t35 CoreFoundation 0x0000000110658a90 CFRunLoopRunSpecific + 562\n\t36 GraphicsServices 0x000000011806dc8e GSEventRunModal + 139\n\t37 UIKitCore 0x000000012877390e -[UIApplication _run] + 928\n\t38 Detox 0x000000010cef678b __detox_UIApplication_run + 365\n\t39 UIKitCore 0x0000000128778569 UIApplicationMain + 101\n\t40 ServiceNSW 0x0000000109b6416c main + 80\n\t41 dyld 0x000000010cb2bf21 start_sim + 10\n\t42 ??? 0x000000010e6ed51e 0x0 + 4537111838\n)","exceptionName":"NSInvalidArgumentException","exceptionReason":"+[UIWindowScene _keyWindowScene]: unrecognized selector sent to class 0x1296ba3d8","queueName":"com.apple.main-thread","threadNumber":1}}

detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"type":"action","action":"scrollTo","params":["bottom"],"predicate":{"type":"id","value":"scroll-whats-new"}},"messageId":3} detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=testee action=AppWillTerminateWithError (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"params":{"threadNumber":1,"queueName":"com.apple.main-thread","errorDetails":"Signal 6 was raised\n(\n\t0 Detox 0x000000010cefdbd5 DTXHandleSignal + 59\n\t1 libsystem_platform.dylib 0x00007fff6fafbdfd _sigtramp + 29\n\t2 ??? 0x0000000000000000 0x0 + 0\n\t3 libsystem_c.dylib 0x00000001160406b7 abort + 130\n\t4 NewRelic 0x000000010e39a0ff -[PLCrashReporter setCrashCallbacks:].cold.1 + 0\n\t5 NewRelic 0x000000010e382601 -[PLCrashReporter generateLiveReportWithThread:] + 0\n\t6 CoreFoundation 0x00000001106f307d handleUncaughtException + 719\n\t7 libobjc.A.dylib 0x000000010ccb5d6e _objc_terminate() + 90\n\t8 Detox 0x000000010cefe0cf dtx_terminate() + 157\n\t9 libc++abi.dylib 0x000000011107c9c7 std::terminate(void (*)()) + 8\n\t10 libc++abi.dylib 0x000000011107f204 cxa_rethrow + 99\n\t11 libobjc.A.dylib 0x000000010ccd0bcf objc_exception_rethrow + 37\n\t12 CoreFoundation 0x0000000110658bb1 CFRunLoopRunSpecific + 851\n\t13 GraphicsServices 0x000000011806dc8e GSEventRunModal + 139\n\t14 UIKitCore 0x000000012877390e -[UIApplication _run] + 928\n\t15 Detox 0x000000010cef678b detox_UIApplication_run + 365\n\t16 UIKitCore 0x0000000128778569 UIApplicationMain + 101\n\t17 ServiceNSW 0x0000000109b6416c main + 80\n\t18 dyld 0x000000010cb2bf21 start_sim + 10\n\t19 ??? 0x000000010e6ed51e 0x0 + 4537111838\n)"},"messageId":-10000,"type":"AppWillTerminateWithError"}`

rajathrao commented 2 years ago

@rajathrao @asafkorem I can reproduce the signal 6 crash in our test.

The app crashed when trying to scroll to the bottom

Mac OS: 12.3 Xcode 13.3 iOS SDK: 15.4 iOS Simulator: iPhone 13 (15.4) react-native:064.2 detox: 17.14.9 react-native-firebase: 14.5.0

`detox[44523] TRACE: [Artifact.js/STOP] stopping SimulatorScreenshot detox[44523] DEBUG: [exec.js/EXEC_CMD, #14] applesimutils --byId F9826F9A-022C-403B-A1C7-BD1C02E895A5 --biometricEnrollment NO detox[44523] DEBUG: [exec.js/EXEC_TRY, #14] Turning off biometric enrollment... detox[44523] ERROR: [exec.js/SPAWN_STDERR, #13] Recording started

detox[44523] TRACE: [exec.js/EXEC_SUCCESS, #14] detox[44523] DEBUG: [exec.js/EXEC_SUCCESS, #14] Deactivated! detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"type":"action","action":"scrollTo","params":["bottom"],"predicate":{"type":"id","value":"scroll-whats-new"}},"messageId":2} detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=testee action=AppWillTerminateWithError (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"messageId":-10000,"type":"AppWillTerminateWithError","params":{"errorDetails":"Exception was thrown: \nNSInvalidArgumentException\n+[UIWindowScene _keyWindowScene]: unrecognized selector sent to class 0x1296ba3d8\n(\n\t0 CoreFoundation 0x00000001106f2d34 exceptionPreprocess + 226\n\t1 libobjc.A.dylib 0x000000010ccd0a65 objc_exception_throw + 48\n\t2 CoreFoundation 0x0000000110701c13 CFExceptionProem + 0\n\t3 CoreFoundation 0x00000001106f72ff forwarding + 1471\n\t4 CoreFoundation 0x00000001106f9488 _CF_forwarding_prep_0 + 120\n\t5 Detox 0x000000010cefc30d +[UIWindow(DetoxUtils) dtx_allKeyWindowSceneWindows] + 76\n\t6 Detox 0x000000010cefee83 +[UIView(DetoxMatchers) dtx_findViewsInKeySceneWindowsPassingPredicate:] + 56\n\t7 Detox 0x000000010cf17803 Detox.Element.(views in _14E24C92C1353FEA1FC68E698CB917EF).getter : Swift.Array<__C.NSObject> + 211\n\t8 Detox 0x000000010cf17b04 Detox.Element.(view in _14E24C92C1353FEA1FC68E698CB917EF).getter : C.NSObject + 52\n\t9 Detox 0x000000010cf181f0 Detox.Element.(extractScrollView in _14E24C92C1353FEA1FC68E698CB917EF)() -> __C.UIScrollView + 32\n\t10 Detox 0x000000010cf0c5a9 Detox.ScrollToEdgeAction.perform(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> + 409\n\t11 Detox 0x000000010cf0c649 vtable thunk for Detox.Action.(perform in _04ABBB5C7C570871DB67625EF38728EC)(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> dispatching to Detox.ScrollToEdgeAction.perform(on: Detox.Element) -> Swift.Optional<Swift.Dictionary<Swift.String, Any>> + 9\n\t12 Detox 0x000000010cf0a3ef Detox.Action.(perform in _04ABBB5C7C570871DB67625EF38728EC)(on: Detox.Element, completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 31\n\t13 Detox 0x000000010cf0e94a partial apply forwarder for closure #1 () -> () in Detox.Action.perform(completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 42\n\t14 Detox 0x000000010cf0e991 partial apply forwarder for reabstraction thunk helper from @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> () + 17\n\t15 Detox 0x000000010cf0bebe reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @calleeunowned @convention(block) () -> () + 14\n\t16 Detox 0x000000010cf03b2e +[DTXAssertionHandler try:error:] + 47\n\t17 Detox 0x000000010cf0a4fe Detox.Action.perform(completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 238\n\t18 Detox 0x000000010cf166a4 function signature specialization <Arg[1] = Dead, Arg[2] = Owned To Guaranteed, Arg[3] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : closure #1 (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> () in closure #2 () -> () in Detox.DetoxManager.webSocket(: Detox.WebSocket, didReceiveAction: Swift.String, params: Swift.Dictionary<Swift.String, Any>, messageId: C.NSNumber) -> (), Argument Types : [Detox.DetoxManagerC.NSNumber]> of static Detox.InvocationManager.invoke(dictionaryRepresentation: Swift.Dictionary<Swift.String, Any>, completionHandler: (Swift.Optional<Swift.Dictionary<Swift.String, Any>>, Swift.Optional) -> ()) -> () + 980\n\t19 Detox 0x000000010cf2f010 partial apply forwarder for closure #2 () -> () in Detox.DetoxManager.webSocket(_: Detox.WebSocket, didReceiveAction: Swift.String, params: Swift.Dictionary<Swift.String, Any>, messageId: C.NSNumber) -> () + 64\n\t20 Detox 0x000000010cf0bebe reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () + 14\n\t21 EarlGrey 0x000000013602058d 59-[GREYUIThreadExecutor executeSyncWithTimeout:block:error:]_block_invoke + 109\n\t22 EarlGrey 0x0000000135fd1008 __54-[GREYRunLoopSpinner grey_checkConditionInActiveMode:]_block_invoke + 472\n\t23 CoreFoundation 0x000000011065f5c9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n\t24 CoreFoundation 0x000000011065e9c7 CFRunLoopDoBlocks + 443\n\t25 CoreFoundation 0x00000001106592e2 CFRunLoopRun + 853\n\t26 CoreFoundation 0x0000000110658a90 CFRunLoopRunSpecific + 562\n\t27 EarlGrey 0x0000000135fd0cfd -[GREYRunLoopSpinner grey_checkConditionInActiveMode:] + 381\n\t28 EarlGrey 0x0000000135fcf962 -[GREYRunLoopSpinner spinWithStopConditionBlock:] + 434\n\t29 EarlGrey 0x000000013601fcb8 -[GREYUIThreadExecutor executeSyncWithTimeout:block:error:] + 1384\n\t30 EarlGrey 0x000000013601f70c -[GREYUIThreadExecutor executeSync:error:] + 364\n\t31 Detox 0x000000010cee5317 __45-[EarlGreyImpl(Detox) detox_safeExecuteSync:]_block_invoke + 134\n\t32 CoreFoundation 0x000000011065f5c9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n\t33 CoreFoundation 0x000000011065e9c7 CFRunLoopDoBlocks + 443\n\t34 CoreFoundation 0x00000001106599b4 __CFRunLoopRun + 2599\n\t35 CoreFoundation 0x0000000110658a90 CFRunLoopRunSpecific + 562\n\t36 GraphicsServices 0x000000011806dc8e GSEventRunModal + 139\n\t37 UIKitCore 0x000000012877390e -[UIApplication _run] + 928\n\t38 Detox 0x000000010cef678b __detox_UIApplication_run + 365\n\t39 UIKitCore 0x0000000128778569 UIApplicationMain + 101\n\t40 ServiceNSW 0x0000000109b6416c main + 80\n\t41 dyld 0x000000010cb2bf21 start_sim + 10\n\t42 ??? 0x000000010e6ed51e 0x0 + 4537111838\n)","exceptionName":"NSInvalidArgumentException","exceptionReason":"+[UIWindowScene _keyWindowScene]: unrecognized selector sent to class 0x1296ba3d8","queueName":"com.apple.main-thread","threadNumber":1}}

detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"type":"action","action":"scrollTo","params":["bottom"],"predicate":{"type":"id","value":"scroll-whats-new"}},"messageId":3} detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [DetoxServer.js/MESSAGE] role=testee action=AppWillTerminateWithError (sessionId=791ee10d-9d84-f7d5-f9d6-8bceb720c3b7) detox[44523] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"params":{"threadNumber":1,"queueName":"com.apple.main-thread","errorDetails":"Signal 6 was raised\n(\n\t0 Detox 0x000000010cefdbd5 DTXHandleSignal + 59\n\t1 libsystem_platform.dylib 0x00007fff6fafbdfd _sigtramp + 29\n\t2 ??? 0x0000000000000000 0x0 + 0\n\t3 libsystem_c.dylib 0x00000001160406b7 abort + 130\n\t4 NewRelic 0x000000010e39a0ff -[PLCrashReporter setCrashCallbacks:].cold.1 + 0\n\t5 NewRelic 0x000000010e382601 -[PLCrashReporter generateLiveReportWithThread:] + 0\n\t6 CoreFoundation 0x00000001106f307d handleUncaughtException + 719\n\t7 libobjc.A.dylib 0x000000010ccb5d6e _objc_terminate() + 90\n\t8 Detox 0x000000010cefe0cf dtx_terminate() + 157\n\t9 libc++abi.dylib 0x000000011107c9c7 std::terminate(void (*)()) + 8\n\t10 libc++abi.dylib 0x000000011107f204 cxa_rethrow + 99\n\t11 libobjc.A.dylib 0x000000010ccd0bcf objc_exception_rethrow + 37\n\t12 CoreFoundation 0x0000000110658bb1 CFRunLoopRunSpecific + 851\n\t13 GraphicsServices 0x000000011806dc8e GSEventRunModal + 139\n\t14 UIKitCore 0x000000012877390e -[UIApplication _run] + 928\n\t15 Detox 0x000000010cef678b detox_UIApplication_run + 365\n\t16 UIKitCore 0x0000000128778569 UIApplicationMain + 101\n\t17 ServiceNSW 0x0000000109b6416c main + 80\n\t18 dyld 0x000000010cb2bf21 start_sim + 10\n\t19 ??? 0x000000010e6ed51e 0x0 + 4537111838\n)"},"messageId":-10000,"type":"AppWillTerminateWithError"}`

I think detox 17.x does not support iOS 15. @wangghon

wangghon commented 2 years ago

@rajathrao We couldn't reproduce the signal 6 crash when we upgrade detox to 19.5.7.

@asafkorem do you have an idea about the issue @kbgar24 and I mentioned not waiting for JS promises to be resolved?

if I want to disable the synchronization to get all the network requests to pass through when launching the app, should I launch the app as below?

beforeAll(async () => { await detox.init(detoxConfig, { launchApp: false }); await device.launchApp({ newInstance: true, // launchArgs: { detoxURLBlacklistRegex: ' \\("^http:\/\/localhost:8500\/.*")' }, launchArgs: { detoxEnableSynchronization: 0 }, permissions: {camera: 'YES', notifications: 'YES'} }); });

I couldn't find more info from API guide.

rajathrao commented 2 years ago

@rajathrao You seem to be using Firebase (I guess through React Native Firebase). What Firebase version and dependencies (Performance, Crashlytics,..) do you use? (please try to upgrade to the latest) @asafkorem we upgraded the firebase and still same error !!

    "@react-native-firebase/app": "^14.0.0",
    "@react-native-firebase/auth": "^14.0.0",
    "@react-native-firebase/crashlytics": "^14.0.0",
    "@react-native-firebase/firestore": "^14.0.0",
    "@react-native-firebase/storage": "^14.0.0",
d4vidi commented 2 years ago

@rajathrao @kbgar24 to either confirm or deny the promises-await theory, you can try to add long sleeps after launch and see whether it helps stabilize things. In any case, these things are tested regularly so I slightly doubt that (could be wrong, of course).

In any case, what seems slightly fishy is the combo of calling both detox.init() and launchApp() in your CustomDetoxEnvironment. Best if you let Detox's environment impl. do that init (don't override that) and only launchApp() inside your beforeAll() or even your test code.

rajathrao commented 2 years ago

@rajathrao @kbgar24 to either confirm or deny the promises-await theory, you can try to add long sleeps after launch and see whether it helps stabilize things. In any case, these things are tested regularly so I slightly doubt that (could be wrong, of course).

In any case, what seems slightly fishy is the combo of calling both detox.init() and launchApp() in your CustomDetoxEnvironment. Best if you let Detox's environment impl. do that init (don't override that) and only launchApp() inside your beforeAll() or even your test code.

@d4vidi long sleeps wont work too. it just does not go past the splash screen

olegderecha commented 2 years ago

Paired with @rajathrao and we found the answer. Based on this link https://githubhot.com/repo/wix/Detox/issues/2944 author advised to use --loglevel trace to get the most extended log. The log is really very extended and before the crash point is says:

{"messageId":-10000,"type":"AppWillTerminateWithError","params":{"exceptionReason":"You must override thesupportedEventsmethod of VydiaRNFileUploader(__detox_sync_URLSessionDelegateProxy)","exceptionName":"NSInternalInconsistencyException","threadNumber":1,"queueName":"com.apple.main-thread","errorDetails":"Exception was thrown: \nNSInternalInconsistencyException\nYou must override thesupportedEventsmethod of VydiaRNFileUploader(__detox_sync_URLSessionDelegateProxy)\n(\n\t0 CoreFoundation 0x000000011b083ae2 __exceptionPreprocess + 226\n\t1 libobjc.A.dylib 0x000000011aa08e78 objc_exception_throw + 48\n\t2 CoreFoundation 0x000000011b08391b +[NSException raise:format:] + 0\n\t3 Foundation 0x00000001133ac633 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166\n\t4 Edge 0x000000010438732a +[RCTEventEmitter initialize] + 362\n\t5 libobjc.A.dylib 0x000000011aa09453 CALLING_SOME_+initialize_METHOD + 17\n\t6 libobjc.A.dylib

Based on it the error text 'you must override the supportedEvents' I found this thread https://github.com/react-native-sensors/react-native-sensors/issues/272#issuecomment-525845839 when guy changed the config from debug to release and it started working - our case.

We are interested in this line from error: {"exceptionReason":"You must override the supportedEvents method of VydiaRNFileUploader. And for sure the package that rises the issue contains this line VydiaRNFileUploader and it comes from… react-native-background-upload! We had a forked library of this package and then we updated to the latest version and the issue has gone.

The flow above contains the steps how to debug and find the package the blocks the normal synchronization, because there are no actually mistakes in the application or detox.

wangghon commented 2 years ago

For additional context:

  • Our Splash screen runs a number of Javascript promises in the background. We suspect that Detox might be losing synchronization with these initial JS promises
  • Probably related to new Detox synchronization implementation?
  • Issue occurs in any Detox version > 17.x

@olegderecha Hi Oleg, do you have any idea about the issue mentioned by @kbgar24?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

asafkorem commented 2 years ago

@rajathrao is this issue still relevant?

ngandhy commented 2 years ago

Looks like it was fixed in https://github.com/wix/Detox/pull/3420

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

asafkorem commented 2 years ago

Looks like this issue is no longer relevant. Please let me know if this error still occurs.

matiasmannarino commented 2 years ago

Upgrade to 19.7 will fix it. https://issuehint.com/issue/wix/Detox/3407#82286146

chenop commented 2 years ago

I can confirm that updating detox version from "detox": "^19.6.9", to "detox": "^19.7.1",

solved the issue

EJohnF commented 11 months ago

face this error on "detox": "20.13.0", when switched to rnx-kit bundler