Skip to content

Conversation

@akutz
Copy link
Collaborator

@akutz akutz commented Sep 17, 2025

What does this PR do, and why is it needed?

This patch updates VM Op to run its unit/integration tests in a random order, in parallel (using as many processes as there are CPUs).

This change reduces the time to test one of the larger packages, ./pkg/providers/vsphere, from 502s to only 88s.

The randomization also ensures both the production code and test code is reslient and more decomposed.

Finally, if there is a need to maintain ordering, because VM Op uses Ginkgo v2, the Ordered decorator may be utilized. There are examples of this in the code-base already, such as in ./pkg/exit/exit_test.go. Just search the project for Ordered, to find such examples, ex.: grep -r 'Ordered,' * .

Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes NA

Are there any special notes for your reviewer:

Please add a release note if necessary:

Speed up and stabilize testing by randomizing and parallelizing all VM Op unit and integration tests.

@github-actions github-actions bot added the size/S Denotes a PR that changes 10-29 lines. label Sep 17, 2025
@akutz akutz force-pushed the feature/randomize-and-parallelize-tests branch 3 times, most recently from 32f4fa3 to 0ca88f8 Compare September 17, 2025 21:45
@github-actions github-actions bot added size/M Denotes a PR that changes 30-99 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Sep 17, 2025
@akutz akutz force-pushed the feature/randomize-and-parallelize-tests branch 2 times, most recently from 3f1bd19 to c9c16e4 Compare September 17, 2025 22:06
@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Sep 17, 2025
@akutz akutz force-pushed the feature/randomize-and-parallelize-tests branch 4 times, most recently from 28611c8 to dcfcc61 Compare September 17, 2025 22:53
This patch updates VM Op to run its unit/integration tests in a
random order, in parallel (using as many processes as there are
CPUs).

This change reduces the time to test one of the larger packages,
./pkg/providers/vsphere, from 502s to only 88s.

The randomization also ensures both the production code and test
code is reslient and more decomposed.

Finally, if there is a need to maintain ordering, because VM Op
uses Ginkgo v2, the Ordered decorator may be utilized. There are
examples of this in the code-base already, such as in
./pkg/exit/exit_test.go. Just search the project for `Ordered,` to
find such examples, ex.: `grep -r 'Ordered,' * `.
@akutz akutz force-pushed the feature/randomize-and-parallelize-tests branch from dcfcc61 to 684682e Compare September 17, 2025 23:14
Copy link
Contributor

@lubronzhan lubronzhan left a comment

Choose a reason for hiding this comment

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

Thanks for refactoring! Especially those in snapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants