Skip to content

Conversation

Swiddis
Copy link
Collaborator

@Swiddis Swiddis commented Sep 2, 2025

Description

Our unit tests don't have any cross-dependency, so we can freely turn on parallelization for them. Makes builds a bit faster locally. (At least the parts where most of the feedback is -- async is still slow but now it runs at the end instead of the start, and will rarely fail when working on anything that isn't specifically async.)

Related Issues

Slow local builds. I want ./gradlew -x doctest -x integTest --parallel to be fast.

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Simeon Widdis <sawiddis@gmail.com>
@vamsimanohar
Copy link
Member

I haven't tested out but thanks for doing this.
These small things save a lot of time. The other day maven repository order killed my time.

@LantaoJin
Copy link
Member

Does this fixing save time of integ-test for building locally with --parallel only, or does it reduce the time of workflow in GitHub CI either?

@Swiddis
Copy link
Collaborator Author

Swiddis commented Sep 2, 2025

It reduces the github CI but not very much -- the individual tasks are parallelized now (so e.g. core:test will be faster), but the tasks are globally still serial. It has the most effect locally where you can -x integTest --parallel.

The problem with enabling parallelism between tasks right now is it seems there's an invisible dependency for integTest, so just gradle build --parallel is failing (even though integTest itself is serial). I've been meaning to figure out what it is. The high CPU usage also causes issues for doctest. In the meantime, I also want to make integTest itself parallel, but haven't been able to get it to even try.

Something we could do is break up our testing action into unit tests, integTest, and doctest as three different actions. Then we run ./gradlew integTest, ./gradlew doctest, and ./gradlew build -x integTest -x doctest --parallel. That'd give us much faster CI overall.

@Swiddis
Copy link
Collaborator Author

Swiddis commented Sep 2, 2025

Something we could do is break up our testing action into unit tests, integTest, and doctest as three different actions. Then we run ./gradlew integTest, ./gradlew doctest, and ./gradlew build -x integTest -x doctest --parallel. That'd give us much faster CI overall.

#4193, looks like it works. If preferred, close this in favor of that, but I'd rather get this merged quicker since it has immediate benefit for local development, and don't want to block this on any issues with those (riskier) CI updates.

@Swiddis Swiddis enabled auto-merge (squash) September 2, 2025 22:41
Copy link
Collaborator

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
LantaoJin
LantaoJin previously approved these changes Sep 3, 2025
@Swiddis
Copy link
Collaborator Author

Swiddis commented Sep 3, 2025

Test failures pending #4215, was passing before doc update

This reverts commit 65461ad.

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
@Swiddis Swiddis force-pushed the feature/parallel-tests branch from f99b5c7 to ea3420a Compare September 3, 2025 19:24
@Swiddis Swiddis requested review from LantaoJin and penghuo September 3, 2025 20:55
@Swiddis Swiddis merged commit 8638460 into opensearch-project:main Sep 3, 2025
23 checks passed
@Swiddis Swiddis mentioned this pull request Sep 5, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants