-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Parallelize package tests in high-cost packages. (#7126)
* test: Parallelize package level tests in high-cost packages. This commit adds `t.Parallel()` calls to the beginning of many tests across several Go packages in OPA. The slowest packages (taking ~10s or more) have been instrumented where possible as a proof-of-concept. On a machine with many cores, the tests now will complete as fast as the slowest test per package, instead of the sum of all the tests in a particular package. * server/server_test: Remove 3x tests from parallel set. This commit fixes a data race that could occur in the `server` package tests, because 3x tests were modifying package variables under `internal/version`. These tests now run sequentially, and are not included in the parallel test set. * plugins/bundle/plugin_test: Remove 2x tests from the parallel set. Two tests in this package modified a package variable directly, and as such cannot be safely run in parallel with each other or any other tests in the package. * topdown/*_test: t.Parallel refactors. This commit wraps up a large batch of fairly mechanical refactorings to add t.Parallel() annotations to almost every test under `topdown`. The tests that could not be safely parallelized now have explicit warning comments on them describing why they are not safe to run in parallel. * storage/disk: t.Parallel refactors. This commit bundles up test parallelization changes for the `storage/disk` package, dramatically reducing its execution time. * topdown/net_test: Remove sub-test parallelization. * rego: t.Parallel refactors. This commit includes a bundle of t.Parallel refactoring changes for the `rego` package, including a timer-related bugfix, and a slight change on a cancellation test to reduce its overall cost during test runs (the logic is preserved, but the mandatory timeouts are lower now). * test: Fixes for sporadic test breakages. --------- Signed-off-by: Philip Conrad <[email protected]>
- Loading branch information
1 parent
c0fe200
commit d2c0459
Showing
47 changed files
with
1,103 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.