jenkinsci / build-timeout-plugin

Jenkins build-timeout plugin
https://plugins.jenkins.io/build-timeout/
31 stars 80 forks source link

chore: Parallelize Tests #121

Closed rahulsom closed 1 year ago

rahulsom commented 1 year ago

This will use all available cores to run tests, and parallelize by all - suite/class/method. On machines with multiple cores, this will vastly improve test performance. These times are on my M1 MBP with 10 (8P + 2E) cores. They were reported by maven on running mvn verify.

I first ran mvn verify and ignored the time. Then I ran it thrice without this change, and thrice with this change.

All times in seconds.

Run 1 Run 2 Run 3 Average
Before 442 448 442 444
After 142 142 142 142
Savings 302
% 68

Testing done

All existing tests pass

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
jtnord commented 1 year ago

this hard codes the values which are not suitable for all environments - rather this should be opted into this where it is run.

Rather than making these changes in multiple plugins please change your environment, and/or make a PR to buildPlugin that CI uses to build the plugins.

For example on a 3 year old i7-10875H this will use 16 forks and surefire is set to use 756MB per fork so 12GB can be needed with this change. As it is hard coded there is no way to change this without editing the pom

krisstern commented 1 year ago

I agree with @jtnord's view on the matter.