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

[lit] add LIT_MAX_WORKERS env variable #76205

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

makslevental
Copy link
Contributor

I find myself fiddling with ARGS "-j" very frequently when switching between groups of tests with LIT_FILTER. Then invariably I accidentally commit ARGS "-j1" or something like that. This env variable (analogous to LIT_FILTER) resolves the issue.

Not sure how to test but I'm pretty sure this is "correct code".

@makslevental makslevental marked this pull request as ready for review December 22, 2023 05:20
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 22, 2023

@llvm/pr-subscribers-testing-tools

Author: Maksim Levental (makslevental)

Changes

I find myself fiddling with ARGS "-j" very frequently when switching between groups of tests with LIT_FILTER. Then invariably I accidentally commit ARGS "-j1" or something like that. This env variable (analogous to LIT_FILTER) resolves the issue.

Not sure how to test but I'm pretty sure this is "correct code".


Full diff: https://github.com/llvm/llvm-project/pull/76205.diff

1 Files Affected:

  • (modified) llvm/utils/lit/lit/cl_arguments.py (+1-1)
diff --git a/llvm/utils/lit/lit/cl_arguments.py b/llvm/utils/lit/lit/cl_arguments.py
index ba3706659550b6..b9122d07afd8a1 100644
--- a/llvm/utils/lit/lit/cl_arguments.py
+++ b/llvm/utils/lit/lit/cl_arguments.py
@@ -36,7 +36,7 @@ def parse_args():
         metavar="N",
         help="Number of workers used for testing",
         type=_positive_int,
-        default=lit.util.usable_core_count(),
+        default=os.getenv("LIT_MAX_WORKERS", lit.util.usable_core_count()),
     )
     parser.add_argument(
         "--config-prefix",

@makslevental
Copy link
Contributor Author

Test fail is in the python bindings in MLIR on windows (weird...)

Copy link
Contributor

@RoboTux RoboTux left a comment

Choose a reason for hiding this comment

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

LGTM

@makslevental makslevental merged commit 3669238 into llvm:main Dec 22, 2023
7 of 8 checks passed
@makslevental makslevental deleted the max_workers_lit branch December 22, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants