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

GitHub Actions > [ANDROID] child-process:EXEC_FAIL #3998

Closed
2 tasks done
mariushorvat opened this issue Mar 28, 2023 · 6 comments
Closed
2 tasks done

GitHub Actions > [ANDROID] child-process:EXEC_FAIL #3998

mariushorvat opened this issue Mar 28, 2023 · 6 comments

Comments

@mariushorvat
Copy link

mariushorvat commented Mar 28, 2023

What happened?

Hi all,
I'm running Android CI/CD GithubActions with a Detox Test Suite.
I've ran into some issues running detox test and I followed this solution from d4vidi #3474 (comment)

Detox get's stuck into this last command before the test start to run:
22:13:26.521 detox[11710] i child-process:EXEC_CMD "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""

Here are the FAIL rest of the logs.

PS I've looked into Stackoverflow and spent few hours on searches but now info.
I wonder that maybe is a bug in the CI GithubActions or in Detox, maybe you can point me somewhere else to look. Thanks!

22:13:28.606 detox[11710] i child-process:EXEC_FAIL ""/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""" failed with error = ChildProcessError: Command failed: "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""
 `"/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""` (exited with error code 1) (code=1), stdout and stderr:

22:13:28.607 detox[11710] i child-process:EXEC_FAIL 
22:13:28.607 detox[11710] i child-process:EXEC_FAIL 
22:13:29.110 detox[11710] i child-process:EXEC_CMD "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""
22:13:30.990 detox[11710] i child-process:EXEC_FAIL ""/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""" failed with error = ChildProcessError: Command failed: "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""
 `"/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.android\.dev$\""` (exited with error code 1) (code=1), stdout and stderr:

22:13:30.991 detox[11710] i child-process:EXEC_FAIL 
22:13:30.991 detox[11710] i child-process:EXEC_FAIL 
22:13:31.[49](https://github.com/React-Native/actions/runs/4547805075/jobs/8018139635#step:11:50)2 detox[11710] i child-process:EXEC_CMD "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-55[54](https://github.com/React-Native/actions/runs/4547805075/jobs/8018139635#step:11:55) shell "ps | grep \"com\.android\.dev$\""

What was the expected behaviour?

As per local run it supposed to start the tests (lifecycle)

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!

name: Detox Tests CI/CD
on:
  pull_request:
  push:
    branches:
      - 'detox-ci


jobs:
  run-detox-android-tests:
    name: Run Detox tests (Android)
    runs-on: ['macos-12']
    timeout-minutes: 100

    env:
      GRADLE_OPTS: -Xmx3200m -XX:+HeapDumpOnOutOfMemoryError -Dkotlin.incremental=false -Dorg.gradle.daemon=false

    steps:
      - name: Checkout repo
        uses: actions/checkout

      - name: Setup Android SDK
        uses: android-actions/setup-android@v2

      - name: Setup gradle
        uses: gradle/gradle-build-action@v2

      - name: Run Android CI setup
        uses: ./.github/workflows/composite/android-ci-setup

      - name: Download Android Emulator Image
        run: |
          sdkmanager='/Users/runner/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager'
          avdmanager='/Users/runner/Library/Android/sdk/cmdline-tools/latest/bin/avdmanager'

          $sdkmanager "system-images;android-33;google_apis;x86_64"
          echo no | $avdmanager -v create avd -f -n Automation_Device -k "system-images;android-33;google_apis;x86_64"
          $avdmanager list avd

          echo "hw.audioInput=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.audioOutput=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.cpu.ncore=2" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.camera.back=none" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.camera.front=none" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.gsmModem=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.gps=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.accelerometer=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.battery=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.trackBall=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.dPad=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.sensors.proximity=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.sensors.magnetic_field=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.sensors.orientation=no" >> /Users/runner/.android/emu-update-last-check.ini
          echo "hw.sensors.temperature=no" >> /Users/runner/.android/emu-update-last-check.ini

      - name: Android Emulator
        timeout-minutes: 4
        continue-on-error: true
        run: |
          sdkmanager='/Users/runner/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager'
          adb='/Users/runner/Library/Android/sdk/platform-tools/adb'
          emulator='/Users/runner/Library/Android/sdk/emulator/emulator'

          echo "Starting emulator"
          echo no | $emulator -avd Automation_Device -no-audio -no-boot-anim -no-window &
          $emulator -list-avds

          $adb wait-for-device
          $adb devices -l
          echo "Emulator started"

      - name: Install Detox
        run: |
          npm install detox-cli --global
          npm install "jest@^29" --save-dev
          npm install detox --save-dev

      - name: Build Detox
        run: |
          detox build --configuration android.ci.debug

      - name: Install Release Debug and AndroidTest Pulse APK
        run: |
          adb='/Users/runner/Library/Android/sdk/platform-tools/adb'
          echo "Is Emulator still working?"
          $adb devices -l
          adb install /Users/runner/work/React-Native/android/app/build/outputs/apk/development/release/app-development-release.apk
          adb install /Users/runner/work/React-Native/android/app/build/outputs/apk/androidTest/development/release/app-development-release-androidTest.apk

      - name: Run Detox Tests
        run: |
          detox test -c android.ci.debug --reuse --runInBand --reporters='default' --loglevel trace --record-logs all


In what environment did this happen?

Detox version: 20.5.0
React Native version: 0.70.5
Has Fabric (React Native's new rendering system) enabled: (no)
Node version: 16.19.0
Device model: emulator
Android version: 33
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

@mariushorvat mariushorvat changed the title [ANDROID] APP_STATUS The app seems to be idle child-process:EXEC_FAIL > [ANDROID] APP_STATUS The app seems to be idle Mar 28, 2023
@mariushorvat mariushorvat changed the title child-process:EXEC_FAIL > [ANDROID] APP_STATUS The app seems to be idle [ANDROID] child-process:EXEC_FAIL > APP_STATUS The app seems to be idle Mar 28, 2023
@mariushorvat mariushorvat changed the title [ANDROID] child-process:EXEC_FAIL > APP_STATUS The app seems to be idle GitHub Actions > [ANDROID] child-process:EXEC_FAIL Mar 29, 2023
@stale
Copy link

stale bot commented May 1, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

@stale stale bot added the 🏚 stale label May 1, 2023
@stale
Copy link

stale bot commented May 8, 2023

The issue has been closed for inactivity.

@stale stale bot closed this as completed May 8, 2023
@d4vidi
Copy link
Collaborator

d4vidi commented May 11, 2023

We've been having issues with emulators running Android >31 (e.g. #3762). Could you try downgrading to v31?

@d4vidi d4vidi reopened this May 11, 2023
@stale stale bot removed the 🏚 stale label May 11, 2023
@hamzaimrann
Copy link

hamzaimrann commented May 16, 2023

Replying to @mariushorvat,

I am facing the same issue in my react-native boilerplate code, Detox setup for iOS is working perfectly whereas android configuration seems to be causing a crash when running 'detox test' command. I have updated some dependencies that are important in this context:

  • React Native - 0.71.4
  • React - 18.2.0
  • All of Jest's dependencies - 29.2.1
  • Detox - 20.6.0
  • Android SDK - Android NDK: 22.1.7171670

Here is my terminal after running: "detox test -c android.emu.debug --record-logs all" with build successfully generated.

16:56:53.100 detox[23705] i Example: should have the login screen first
16:56:56.390 detox[23705] i ""/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""" failed with error = ChildProcessError: Command failed: "/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""
 `"/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""` (exited with error code 1) (code=1), stdout and stderr:

16:56:56.391 detox[23705] i 
16:56:56.391 detox[23705] i 
16:56:58.521 detox[23705] i ""/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""" failed with error = ChildProcessError: Command failed: "/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""
 `"/Users/mac/Library/Android/sdk/platform-tools/adb" -s emulator-16888 shell "ps | grep \"com\.stagingapp$\""` (exited with error code 1) (code=1), stdout and stderr:

16:56:58.522 detox[23705] i 
16:56:58.523 detox[23705] i 
16:58:53.182 detox[23705] i Detox can't seem to connect to the test app(s)!

HINT: 

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs 



16:58:53.184 detox[23705] i Example: should have the login screen first [FAIL]
16:58:53.198 detox[23705] i Example: should go to welcome screen after logging in
16:58:53.293 detox[23705] i Detox can't seem to connect to the test app(s)!

HINT: 

Have you forgotten to call 'device.launchApp()' in the beginning of your test?
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs

---
The following package could not be delivered:

{
  type: 'invoke',
  params: [Object],
  messageId: 1
}
16:58:53.698 detox[23705] i Detox can't seem to connect to the test app(s)!

HINT: 

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs 



16:58:53.698 detox[23705] i Example: should go to welcome screen after logging in [FAIL]

16:58:54.132 detox[23705] i Detox can't seem to connect to the test app(s)!

HINT: 

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs 



16:58:54.141 detox[23705] i An error occurred while waiting for the app to become ready. Waiting for disconnection...
  error: Failed to run application on the device
  
  HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process.
16:58:54.142 detox[23705] i The app disconnected.
 FAIL  e2e/firstTest.spec.test.js (163.35 s)
  Example
    ✕ should have the login screen first (120013 ms)
    ✕ should go to welcome screen after logging in (98 ms)

  ● Example › should have the login screen first

    thrown: "Exceeded timeout of 120000 ms for a hook.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      4 |
      5 | describe("Example", () => {
    > 6 |   beforeEach(async () => {
        |   ^
      7 |     await device.launchApp();
      8 |   });
      9 |

      at beforeEach (e2e/firstTest.spec.test.js:6:3)
      at Object.describe (e2e/firstTest.spec.test.js:5:1)

  ● Example › should go to welcome screen after logging in

    Detox can't seem to connect to the test app(s)!

    HINT: 

    Have you forgotten to call 'device.launchApp()' in the beginning of your test?
    Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs

    ---
    The following package could not be delivered:

    {
      type: 'invoke',
      params: [Object],
      messageId: 1
    }



16:58:54.286 detox[23702] E Command failed with exit code = 1:
jest --config e2e/jest.config.js

Below I have attached complete device and detox log files
-Detox:
detox.log

-Device:
device.log

@stale
Copy link

stale bot commented Jun 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

@stale stale bot added the 🏚 stale label Jun 17, 2023
@stale
Copy link

stale bot commented Jul 15, 2023

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jul 15, 2023
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

3 participants