apache / apache/netbeans

tests in module java.refactoring are excessively slow

Open
#8,160 7 comments 0 reactions 0 assignees View on GitHub
kind:feature needs:triage tests
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

# The first test in each test class takes 18.000 milliseconds on average.

With 31 test classes in the `org.netbeans.modules.refactoring.java.test` package alone, that is a huge waiting bill, or stated otherwise it takes my caffeine level over healthy values.
Since some of these tests involve the GUI, working on other things on the same machine is unproductive, because your work will lose focus.

### Use case/motivation

Run the tests in package `refactoring/netbeans/org.netbeans.modules.refactoring.java.test` and measure.
NetBeans will do that for you. The last run on my machine (AMD64, 24 virtual cores, that do not help,32 Gigs of memory for me and netbeans alone).

![Image](https://github.com/user-attachments/assets/b09c3679-a150-40cf-bb5c-d67d023100a7)

I would replace the method `writeFilesAndWaitForScan` with one that skips the *wait for scan* part. The wait for scan part is
documented as use with care, it takes a long time. From experience some, maybe a lot more can do without the full scan.

I will be waiting for approval before starting this effort.

### Related issues

developing/adding features/resolve bugs. #7043, #7044

### Are you willing to submit a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

Run the tests in refactoring/netbeans/org.netbeans.modules.refactoring.java.test and measure the current delay, then inspect the writeFilesAndWaitForScan method and its uses. Done means the applicable tests no longer incur unnecessary scan waits while continuing to pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.