React Native iOS Detox e2e tests failing

Bitrise Build Issue Report template

Description of the issue

I am unable to run end to end tests with detox on my react native app. I think it is because of a problem launching the metro bundler.

The command
detox test --configuration ios.sim.debug --cleanup
fails giving the error

    Example: should have welcome title
    Example: should have welcome title [FAIL]
    FAIL e2e/firstTest.spec.js (302.096s)
      Example
        âś• should have welcome title (16ms)
      ● Example › should have welcome title
        Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.
          at mapper (../node_modules/jest-jasmine2/build/queueRunner.js:25:45)

Interestingly, if I ssh into the box, and run

react-native start &
detox test --configuration ios.sim.debug --cleanup

the error is not reproducible, which leads me to believe that the metro bundler is not launched correctly within the enviroment.

Environment:

Bitrise IO on XCode 11.1.x on MacOS 10.14.6 (Mojave)

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : Not applicable
  • When did the issue start? :

Local reproduction

Cannot be reproduced locally from a fresh git clone

Build log

1 Like

I’m having the same issue, i’ve tried using react-native start > /dev/null to suppress the metro bundler output but the issue still remains.

1 Like

I have now fixed the issue. The key is to build and test for release. You can do this with the commands

detox build --configuration ios.sim.release --cleanup
and
detox test --configuration ios.sim.release --cleanup

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.