Detox Build issue

Description of the issue

I am trying to run Detox tests for Android App. It works in local. But when I run in bitrise it is stuck and getting timeout eventually. Detox build is successful and apk is generated successfully. I tried with Android ubuntu stack as well and tried multiple images like google_apis, google_apis_playstore,default, different android images. It doesnt help.

Environment:

Where did the issue happen?

Stack : XCode 13.0.x, Mac OS 11.4(Big Sur)
Xcode : 13.0.x
Detox: 19.3.1

Which build Step causes the issue and which version of the step?

Highlighted step is where failing. (detox tests)

format_version: ‘11’
default_step_lib_source: GitHub - bitrise-io/bitrise-steplib: New Bitrise StepLib
project_type: react-native
trigger_map:

  • push_branch: MBI-7610
    workflow: tests
    workflows:
    tests:
    steps:
    • activate-ssh-key@4: {}
    • git-clone@6: {}
    • nvm@1: {}
    • yarn:
      inputs:
      • command: install
        title: Yarn Install
    • script:
      inputs:
      • is_debug: ‘yes’
      • content: "#!/bin/bash\n\nyarn global add envinfo detox-cli && envinfo\nbrew
        tap wix/brew && brew install applesimutils "
        title: Install Detox CLI
    • avd-manager@1:
      inputs:
      • name: “$EMULATOR_NAME”
      • abi: x86_64
      • profile: pixel_3a
      • emulator_channel: ‘2’
      • tag: google_apis
      • emulator_id: Pixel_3a_API_30_x86
      • api_level: ‘30’
    • wait-for-android-emulator@1:
      inputs:
      • boot_timeout: ‘360000’
    • script:
      inputs:
      • is_debug: ‘yes’

      • content: |-
        #!/bin/bash

        yarn detox build --configuration android30
        title: Detox - Build Release App (Android)

    • script:
      inputs:
      • is_debug: ‘yes’

      • content: |-
        #!/bin/bash

        yarn detox test --configuration android30 jest --config e2e/config.json --testNamePattern ‘^((?!:android:).)*$’ e2e --loglevel verbose --record-logs all
        title: Detox - Run E2E Tests (android)
        meta:
        bitrise.io:
        stack: osx-xcode-13.2.x
        meta:
        bitrise.io:
        stack: osx-xcode-13.0.x
        app:
        envs:

    • opts:
      is_expand: false
      WORKDIR: “.”
    • PROJECT_LOCATION: android
      opts:
      is_expand: false
    • EMULATOR_NAME: Pixel_3a_API_30_x86
      outputs:
  • BITRISE_APK_PATH: android/app/build/outputs/apk/alpha/debug/app-alpha-debug.apk
    opts:
    title: Path of the generated APK
    summary: Path of the generated (and copied) APK - after filtering.
    description: |-
    This output will include the path of the generated APK
    after filtering based on the filter inputs.
    If the build generates more than one APK which fulfills the
    filter inputs, this output will contain the last one’s path.

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? : YES
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? :First time trying

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what bitrise.io will get when it does a git clone in the clean environment! If possible please note which sections you tried.

Unable to start Android Manager using bitrise cli. But running detox commands is successful.

Local reproduction: Linux / Android (docker based) stack builds

Can it be reproduced by running the build locally, after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: Running your build locally in Docker - Bitrise Docs .

The link to run in local with docker is not found.

Build log

Please copy paste the build’s bitrise.io URL here (or if the issue happens somewhere else then the full logs), or if you can’t share the url / log here then send the url or full log through a private channel (e.g. email - Contact us ), with a link to the related Discuss issue.

detox[6151] DEBUG: [SPAWN_CMD, #6228] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:40157 -e detoxSessionId a8e9635f-3e90-6751-999f-2aa57f6255e2 -e debug false com.app/androidx.test.runner.AndroidJUnitRunner
detox[6151] DEBUG: [EXEC_CMD, #21] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “ps | grep "com.app$"”
detox[6151] DEBUG: [SPAWN_CMD, #6233] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell “logcat -T "03-06 17:31:52.000" --pid=2962 -f /sdcard/17315215_0.log”
detox[6151] DEBUG: [EXEC_CMD, #22] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell du /sdcard/17315215_0.log
detox[6151] DEBUG: [WSS_CONNECTION, #43447] registered a new connection.
detox[6151] DEBUG: [APP_STATUS] Failed to execute the current status query.
detox[6151] INFO: Onboarding: should have welcome screen
detox[6151] INFO: Onboarding: should have welcome screen [FAIL]
detox[6151] INFO: Onboarding: should show login screen after tap
detox[6151] INFO: Onboarding: should show login screen after tap [FAIL]
detox[6151] INFO: Onboarding: should show signup screen after tap
detox[6151] INFO: Onboarding: should show signup screen after tap [FAIL]
detox[6151] INFO: Onboarding: should show forgot password screen after tap
detox[6151] INFO: Onboarding: should show forgot password screen after tap [FAIL]
detox[6151] DEBUG: [EXEC_CMD, #23] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “date +"%m-%d %T.000"”
detox[6151] DEBUG: [SPAWN_END, #6233] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell “logcat -T "03-06 17:31:52.000" --pid=2962 -f /sdcard/17315215_0.log” terminated with SIGINT
detox[6151] DEBUG: [EXEC_CMD, #24] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 pull “/sdcard/17315215_0.log” “artifacts/android27.2022-03-06 17-31-02Z/emulator-5554 2022-03-06 17-33-52Z.startup.log”
detox[6151] DEBUG: [EXEC_CMD, #25] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “rm "/sdcard/17315215_0.log"”
detox[6151] DEBUG: [MOVE_FILE] moving “/tmp/050217f6-2a0a-4333-ac14-101cd8f6db6b.detox.log” to artifacts/android27.2022-03-06 17-31-02Z/detox_pid_6151.json.log
detox[6151] DEBUG: [MOVE_FILE] moving “/tmp/8ca4db06-db3d-481b-b7c2-079321ca71a6.detox.log” to artifacts/android27.2022-03-06 17-31-02Z/detox_pid_6151.log
detox[6151] WARN: [PENDING_REQUESTS] The app has not responded to the network requests below:
(id = 1) currentStatus: {}
(id = -1000) isReady: {}
Unresponded network requests might result in timeout errors in Detox tests.
detox[6151] ERROR: [Client.js/ERROR] The pending request #-49642 (“cleanup”) has been rejected due to the following error:
The tester has not received a response within 5000ms timeout to the message:
Cleanup {
type: ‘cleanup’,
params: [Object],
messageId: -49642
}
detox[6151] DEBUG: [SPAWN_END, #6228] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:40157 -e detoxSessionId a8e9635f-3e90-6751-999f-2aa57f6255e2 -e debug false com.app.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT
detox[6151] DEBUG: [EXEC_CMD, #26] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 reverse --remove tcp:40157
detox[6151] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
FAIL e2e/onboarding.e2e.js (174.182 s)
Onboarding
✕ should have welcome screen (1 ms)
✕ should show login screen after tap
✕ should show signup screen after tap
✕ should show forgot password screen after tap
● Onboarding â€ș should have welcome screen
thrown: “Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”
1 | describe(‘Onboarding’, () => {
> 2 | beforeAll(async () => {
| ^
3 | console.log(“awaiting launch app”);
4 | await device.launchApp({ newInstance: true });
5 | console.log(“done launch app”);
at onboarding.e2e.js:2:3
at Object. (onboarding.e2e.js:1:1)
● Onboarding â€ș should show login screen after tap
thrown: “Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”
1 | describe(‘Onboarding’, () => {
> 2 | beforeAll(async () => {
| ^
3 | console.log(“awaiting launch app”);
4 | await device.launchApp({ newInstance: true });
5 | console.log(“done launch app”);
at onboarding.e2e.js:2:3
at Object. (onboarding.e2e.js:1:1)
● Onboarding â€ș should show signup screen after tap
thrown: “Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”
1 | describe(‘Onboarding’, () => {
> 2 | beforeAll(async () => {
| ^
3 | console.log(“awaiting launch app”);
4 | await device.launchApp({ newInstance: true });
5 | console.log(“done launch app”);
at onboarding.e2e.js:2:3
at Object. (onboarding.e2e.js:1:1)
● Onboarding â€ș should show forgot password screen after tap
thrown: “Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”
1 | describe(‘Onboarding’, () => {
> 2 | beforeAll(async () => {
| ^
3 | console.log(“awaiting launch app”);
4 | await device.launchApp({ newInstance: true });
5 | console.log(“done launch app”);
at onboarding.e2e.js:2:3
at Object. (onboarding.e2e.js:1:1)
detox[6139] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern ‘^((?!:android:).)*$’ jest e2e

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