Skip to content

OutOfMemoryError during connectedDebugAndroidTest #444

@waffiqaziz

Description

@waffiqaziz

Description:

I'm encountering a java.lang.OutOfMemoryError when running connectedDebugAndroidTest. The error happens during instrumentation tests on the emulator and crashes the process with no usable stack trace.

Stack trace / log output:

> Task :feature:search:connectedDebugAndroidTest
com.waffiq.bazz_movies.feature.search.ui.SearchFragmentTest > onConfigurationChanged_whenKeyboardHidden_callsExpandMethod[emulator-5554 - 10] FAILED
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available

com.waffiq.bazz_movies.feature.search.ui.SearchFragmentTest > openSearchView_expandsSearchView[emulator-5554 - 10] FAILED
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available

emulator-5554 - 10 Tests 24/24 completed. (0 skipped) (2 failed)
Finished 24 tests on emulator-5554 - 10

> Task :feature:search:connectedDebugAndroidTest
Tests on emulator-5554 - 10 failed: There was 2 failure(s).
Logcat of last crash:
Process: com.waffiq.bazz_movies.feature.search.test, PID: 3801
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available

> Task :feature:search:connectedDebugAndroidTest FAILED

full stack trace

My config

      - name: Enable KVM
        run: |
          echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
          sudo udevadm control --reload-rules
          sudo udevadm trigger --name-match=kvm
      - name: Gradle cache
        uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96

      - name: AVD cache
        uses: actions/cache@v4
        id: avd-cache
        with:
          path: |
            ~/.android/avd/*
            ~/.android/adb*
          key: avd-29

      - name: create AVD and generate snapshot for caching
        if: steps.avd-cache.outputs.cache-hit != 'true'
        uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed
        with:
          api-level: 29
          force-avd-creation: false
          emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: false
          script: echo "Generated AVD snapshot for caching."

      # https://github.com/ReactiveCircus/android-emulator-runner/commit/1dcd0090116d15e7c562f8db72807de5e036a4ed
      # v2.34.0
      - name: Run instrumentation test
        uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed
        with:
          api-level: 29
          force-avd-creation: false
          emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: true
          script: |
            ./gradlew :feature:login:connectedDebugAndroidTest --stacktrace --continue
            ./gradlew :feature:search:connectedDebugAndroidTest --stacktrace --continue
            killall -INT crashpad_handler || true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions