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

Deadlock during start with new architecture on iOS #4506

Open
2 tasks done
TimotheeIsnard opened this issue Jun 10, 2024 · 0 comments
Open
2 tasks done

Deadlock during start with new architecture on iOS #4506

TimotheeIsnard opened this issue Jun 10, 2024 · 0 comments

Comments

@TimotheeIsnard
Copy link

What happened?

Hello,
I have a React Native app that I test on iOS, on both the old and new RN architecture, and when starting the app with the new architecture enabled Detox freezes while trying to first enable synchronization.
There is no freeze on the old RN architecture.

I tried --debug-synchronization, but it has nothing to say, since Detox seems to block internally before reaching the app code.
By adding logs and following in a debugger, I found that the freeze comes from the waitForReactNativeLoadWithCompletionHandler function in DetoxSync.

I opened a PR in DetoxSync that fixes the deadlock for me, but there may be other ways to solve the freeze, so I wanted to make a bug report here anyways (also, this repo seems more active)
DetoxSync PR: wix-incubator/DetoxSync#74

What was the expected behaviour?

Detox should start on iOS with the new architecture enabled.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

The freeze reproduces 100% of the time, if I do either a regular await device.launchApp(), or a manual:

  const detoxArgs = {
    launchArgs: {
      detoxEnableSynchronization: 0,
      'DTXEnableVerboseSyncSystem': 'YES',
      'DTXEnableVerboseSyncResources': 'YES'
    },
  };
  await device.launchApp(detoxArgs);

  console.log('Device launched, enabling sync again soon...');
  await new Promise((r) => setTimeout(r, 5000));
  console.log('Device launched, enabling sync again');
  await device.enableSynchronization();

In what environment did this happen?

Detox version: 20.22.2
React Native version: 0.73
Has Fabric (React Native's new rendering system) enabled: Yes
Node version: 22.2.0
Device model: iPhone 15 simulator
iOS version: 17.5
macOS version: Sonoma 14.5
Xcode version: 15.4 (15F31d)
Test-runner (select one): jest

Detox logs

Detox logs (in attachment due to 65kB github comment limit): detox_loglevel_trace.txt

Device logs

No response

More data, please!

Output of xcrun simctl spawn booted log stream --level debug --style compact | tee detoxlog:
detox_xcrun_log.tar.gz (13 MB uncompressed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant