android / android/android-test

LMKD is killing `androidx.test.services` during test runs

Open
#1,668 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### Description

`connectedAndroidTest` runs are failing with the error "Instrumentation run failed due to Process crashed." which is caused by the `lmkd` killing `androidx.test.services` to reclaim memory.

### Steps to Reproduce

Need to create a low-memory situation and then run `./gradlew connectedAndroidTest`

### Expected Results

connectedAndroidTest runs and completes successfully

### Actual Results

connectedAndroidTest runs, but fails after one or two tests with the error message: "Test run failed to complete. Instrumentation run failed due to Process crashed."

Inspecting logcat gives the following:

> 2023-01-30 15:17:46.821 483-483 lmkd lmkd I Reclaim 'androidx.test.services' (15979), uid 10272, oom_score_adj 200, state 4 to free 45252kB rss, 46040kb swap

### AndroidX Test and Android OS Versions

Android OS: 12
Device: Samsung TabActive 3

'androidx.test:orchestrator:1.4.2'
'androidx.test:runner:1.5.2'
'androidx.test:rules:1.5.0'
"androidx.test:monitor:1.6.1"
'androidx.test.ext:junit:1.1.5'
'androidx.test.espresso:espresso-core:3.5.1'
'androidx.test.uiautomator:uiautomator:2.2.0'
'androidx.navigation:navigation-testing:2.5.3'

### Link to a public git repo demonstrating the problem:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with ./gradlew connectedAndroidTest under low-memory conditions on Android 12, then inspect logcat for lmkd killing androidx.test.services. Review the listed AndroidX Test dependencies and confirm that connectedAndroidTest completes successfully without the instrumentation process crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.