Detox: Crash in DetoxSync
I have an issue when running tests in parallel with --workers 2
using jest-circus
after upgrading to detox 18
The form tests that use the keyboard actions like typeText
and clearText
fail when they are running in parallel with another test.
Reproduction
- Have 2 tests, one that is verifying some on screen behaviour (fx. navigation or button actions) and one that is testing some form actions like entering and removing text in inputs to check form validation logic
- Run the tests in parallel with
--workers 2
usingjest-circus
as a runner - See the tests fail with random errors and a sync issue
I also get this error thrown in one of the tests when running in parallel
thrown: "Signal 11 was raised
(
0 Detox 0x000000010aa97ef5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
1 Detox 0x000000010aa9b100 __DTXHandleCrash + 464
2 Detox 0x000000010aa9b845 __DTXHandleSignal + 59
3 libsystem_platform.dylib 0x00007fff6115a5fd _sigtramp + 29
4 ??? 0x0000000000000000 0x0 + 0
5 DetoxSync 0x000000010b861aaf -[_DTXTimerTrampoline fire:] + 188
6 DetoxSync 0x000000010b849ef0 _DTXCFTimerTrampoline + 74
7 CoreFoundation 0x00007fff20390c57 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
8 CoreFoundation 0x00007fff2039072a __CFRunLoopDoTimer + 926
9 CoreFoundation 0x00007fff2038fcdd __CFRunLoopDoTimers + 265
10 CoreFoundation 0x00007fff2038a35e __CFRunLoopRun + 1949
11 CoreFoundation 0x00007fff203896d6 CFRunLoopRunSpecific + 567
12 App 0x00000001080f2fd1 +[RCTCxxBridge runRunLoop] + 993
13 DetoxSync 0x000000010b8523c0 swz_runRunLoopThread + 291
14 Foundation 0x00007fff20858e68 __NSThread__start__ + 1042
15 libsystem_pthread.dylib 0x00007fff61167109 _pthread_start + 148
16 libsystem_pthread.dylib 0x00007fff61162b8b thread_start + 15
)"
Expected behaviour
The tests should pass just like when you run them with --maxWorkers 1
Environment (please complete the following information):
-
Detox: 18.3.1
-
React Native: 0.63.4
-
Node: 14.15.4
-
Device: iPhone 8
-
Xcode: 12.3
-
iOS: 14.4
-
macOS: 10.15.7
-
I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much, I have read synchronization debug documentation and am providing the relevant synchronization debug output below:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 9
- Comments: 102 (51 by maintainers)
Commits related to this issue
- Add https://github.com/wix/Detox/issues/2641 repro — committed to PlayerData/DetoxFirebaseReproTemplate by ball-hayden 3 years ago
- iOS(AppleSimUtils): enable NSZombies on app launch. This workaround solves the issue described here: https://github.com/firebase/firebase-ios-sdk/issues/9083 And some of the crashes that was mention... — committed to asafkorem/Detox by asafkorem 3 years ago
- iOS(AppleSimUtils): enable NSZombies on app launch. This workaround solves the issue described here: https://github.com/firebase/firebase-ios-sdk/issues/9083 And some of the crashes that was mention... — committed to wix/Detox by asafkorem 3 years ago
@alon-ha any update about this?
@ball-hayden Thank you for the example. I’m hoping to start working on that this week. I already checked the swizzling in detox and seems that it was done correctly. Hopefully I can fix it in our side, but my best solution might be to open a PR to Firebase. Will keep you guys update
https://github.com/wix/Detox/pull/3135 was merged, it should solve the issue of DetoxSync crashes when Firebase/Performance is integrated, it was tested on the example apps that reproduced this issue. @tomphilbin @shamilovtim @wdospinal CC
Once you have updated a version (to the latest/next version), if any of you are still having Signal 11 crashes on DetoxSync when Firebase/Performance is integrated, please open a new bug report with the required details.
As for the parallel
--workers
issue, I think that there’s still missing information here, since I fail to reproduce it myself @denissb Can any of the reporters reproduce this issue with our template app? https://github.com/wix-incubator/DetoxTemplate@param-finder I will investigate soon the crashes with Expo. Can you please open a designated issue for this bug you have?
This is still very much an issue.
There’s been some further discussion over on https://github.com/wix/Detox/issues/3000 and https://github.com/wix/Detox/issues/2802. I’m not sure if these are duplicates, potentially?
Is there any update on this? I assume a fair few projects are a major version behind now and still on v17 because of this issue. I know we certainly are
Hey @asafkorem, many thanks for looking into this issue! I have a repository that reproduces the issue here: https://github.com/tomphilbin/DetoxFirebaseTest
Running
detox build -c ios
and thendetox test -c ios
should lead to theSignal 11
issue, although it may take a few runs. After removing the firebase perf module withyarn remove @react-native-firebase/perf && cd ios && pod install && cd ..
and rerunning the tests, they should pass consistently.My team has had this issue in our project for around a year and we have workarounds in our CI/CD pipelines to do something similar to the above. We keep our dependencies up-to-date and this issue has been consistent during our upgrades of detox.
Thanks again for your time looking into this!
@alon-ha I’ve just run https://github.com/PlayerData/DetoxFirebaseReproTemplate with
[FIRApp configure]
commented out, and all the tests pass.We currently don’t have a starter template. I’m working on one exactly for such cases
Yeah - @d4vidi there’s some more information in #3207.
Both myself and @shamilovtim are struggling to isolate what causes this, so I appreciate there isn’t a huge amount that can be done at the moment.
It is still an issue, however, so IMHO shouldn’t be marked as stale.
Can we move to this thread? https://github.com/wix/Detox/issues/3207
After updating all the above
@react-native-firebase
packages to14.2.4
issue was resolved for meif your project doesn’t depend on firebase perf you can remove that dependency from your package json and rebuild your app without the perf module. Another solution could be downgrading to a version that doesn’t contain Detox Sync
@alon-ha let’s pair on this, later this week 🙏🏻
Have some tasks but hopefully I will get to it in this week
Everything is possible (: But running a describe block inside a loop won’t work regardless… So I need a valid example which reproduce the bug. As you assumed simply duplicating the test file won’t trigger a crash. The example should be something that without
[FIRApp configure];
will probably work right but crash with it@alon-ha my apologies - I’ve done a bit more reading into the
GoogleService-Info.plist
file and the contents are unique but considered to be non-secret.I’ve pushed one to my original demo project. I’ll also get a fork of the DetoxTemplate fully setup.
I believe it was kotlin-native (compiles to iOS) so that’s why it was iOS relevant. The underlying issue caused a bug in iOS code but it connected to kotlin code.