Detox tests hang with pending items on dispatch queue
See original GitHub issueDescription
I am writing e2e tests on Detox to test a Firebase app. It looks like the call to firebase.auth().signInWithPhoneNumber(number)
dispatches some items on the dispatch queue but these items don’t ever seem to be dequeued and therefore the tests cannot proceed. My hunch is that there is a network request being made by the sign in call that never resolves. Here is the log:
Here is the log:
12:46:14.209 detox[41991] INFO: [APP_STATUS] The app is busy with the following tasks:
• There are 2 work items pending on the dispatch queue: "Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)".
• Run loop "Main Run Loop" is awake.
I have read through this troubleshooting guide and it looks like the operation is on the Main thread (native) and the issue is a waiting too much issue.
Is there a way to inspect the items on the dispatch queue to further understand what they are? I have tried running the /usr/bin/xcrun simctl spawn <device> log stream --level debug --style compact --predicate 'process == "myapp"'
but I don’t understand the output. If it is useful I can upload the logs.
I’m hoping I can post some logs of some sort and someone can help me to find the reason for the items on the dispatch queue. I have no experience with native development so device system logs and Objective C/Swift code mean nothing to me. Thanks
Your environment
Detox version: 19.4.2
React Native version: 0.67.4
Node version: v12.22.6
Device model: iPhone 11 Simulator
OS: iOS
Test-runner (select one): jest-circus
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:5
I am having the exact same issue.
On our side, the interaction happening relates to:
firebaseAuth().signInWithPhoneNumber()
call out into another view reproduces the synchronization problem::I have inspected the RNFB/Auth implementation and it is rather simple. The blocking call ends up being:
which eventually makes it here:
which calls into the problematic function:
I haven’t fully dissected the above function but refactoring
internalVerifyPhoneNumber
such that it doesn’t callcheckNotificationForwardingWithCallback
allows detox to progress.@DerrickAfrifa could you tell me what versions of RNFirebase/Expo you are running? @d4vidi would you have any pointers explaining why detox fails to synchronise when
checkNotificationForwardingWithCallback
is called?Another mystery here is why is this bug related to updating expo to SDK 45…
A PR is in progress (see above ^) for this to be fixed upstream, but in the meantime you can refer to this stack overflow answer for a fix.