Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Parallelize tests #304

Merged
merged 1 commit into from
Jul 14, 2023
Merged

Conversation

rahulsom
Copy link
Contributor

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

Before parallelizing

Total time:  07:19 min

After parallelizing

Total time:  02:15 min

Testing done

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

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`

Before parallelizing

```
Total time:  07:19 min
```

After parallelizing

```
Total time:  02:15 min
```
@rahulsom rahulsom requested a review from a team as a code owner July 13, 2023 16:40
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@NotMyFault NotMyFault merged commit fa4e819 into jenkinsci:master Jul 14, 2023
16 checks passed
@jtnord
Copy link
Member

jtnord commented Jul 17, 2023

if it was this easy it would have been done in the plugin-pom and not in multiple plugins.

This is environmental setup that is best left for the person/thing that is running the tests. Users can set -DforkCount=12 should they wish before this change, after this change -DforkCount=1 does not work. Users with high CPU count machines now require high memory as they can no longer tune this, e.g. a 3 year old i7 laptop chip with 16 logical processors requires 12GB of ram just to run the surefire forks defined here.

TL;DR users should set this in the CLI invocation, the jenkinsci buildPlugin could allow a way for this to be set for plugins running in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants