android / android/android-test

Orchestrator sometimes runs all the instances of a parameterized test in the same process

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

Description

### Description

Orchestrator has a fast path that skips test discovery if the test target is a single method:

https://github.com/android/android-test/blob/dd62f39c79bddbaa3b3c0aad2976ba635a5550ea/runner/android_test_orchestrator/java/androidx/test/orchestrator/AndroidTestOrchestrator.java#L259-L262

This doesn't work for parameterized tests, since even a single method target may expand to any number of parameterized test instances.

### Steps to Reproduce

Run a parameterized test method through test orchestrator. They will all run in the same process. You can verify this by logging the PID.

### Expected Results

Each instance of the parameterized test runs in its own process.

### Actual Results

All of the instances of the parameterized test run in the same process.

Contributor guide

Open the contributing guide

Research direction

Start at AndroidTestOrchestrator.java lines 259-262 and inspect the single-method fast path. Reproduce the issue with a parameterized test through the test orchestrator, logging the PID for each instance; done means every parameterized instance runs in its own process rather than sharing one.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.