microsoft / microsoft/vscode-java-test
Multiple selections in test UI run individually/isolated
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 340
- Forks
- 173
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 18
Description
Originally raised at redhat-developer/vscode-java#4338.
Observed behaviour: multiple methods under a Java test class (or multiple test classes under a package) selected in the Tests sidebar tree seem to run significantly slower than when just selecting the single parent class (or package).
This seems to be because each selection does a full setup/teardown (i.e. selecting a class does one setup/teardown cycle, before the first and after the last method; selecting four methods from that class does four cycles, one around each method). For projects like Spring web applications and their unit tests, the application is recreated unnecessarily for each test, and for large applications this causes a significant slowdown. Repeating failed unit tests from a previous run doesn't seem to be affected in this way.
My understanding is that JUnit at least doesn't provide much of a test selection interface, so I'm assuming there's a custom runner in play in order to target the selected or previously-failed tests in the first place.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the slowdown from the Tests sidebar with multiple methods and classes, comparing it with selecting the parent class or package. Trace the custom selection and execution path, paying attention to where setup and teardown are invoked. Done means multiple selections share the appropriate setup/teardown cycle without changing reruns of previously failed tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript
- Domain
- performance, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100