android / android/android-test

Orchestrator fails if service disconnects

Open
#396 1 comment 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
Our test suite has recently begun crashing without running all the tests.

From logcat, it looks like we are running into memory pressure and Android is killing the Orchestration Service.

The OrchestratedInstrumentationListener code does not trigger a reconnect to the service on disconnect, and this makes tests fail if the service is killed. Once the service is killed there is no way to recover. The code should be updated to rebind the service on an unbind.

In addition the service is not being bound with flag Service.BIND_IMPORTANT which would make the Orchestration Service less likely to be killed under memory pressure.

### Steps to Reproduce
I have outlined steps to reproduce here:
https://issuetracker.google.com/issues/135574731

Note that you may have to add tests which consume memory to cause the service to be killed.

### Expected Results
The orchestrator does not crash.

### Actual Results
The orchestrator crashes and only a small subset of our tests are run.

### AndroidX Test and Android OS Versions
AndroidX 1.2.0 - Tested on both 26 and 27.

Contributor guide

Open the contributing guide

Research direction

Start with OrchestratedInstrumentationListener and the service-binding code, then follow the reproduction steps in issuetracker.google.com/issues/135574731 on AndroidX Test 1.2.0 with Android 26 or 27. Verify behavior when Android kills the Orchestration Service under memory pressure; done means the service is rebound after unbind, is bound with Service.BIND_IMPORTANT, and the full test suite continues.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.