[llvm] [lit] add `LIT_MAX_WORKERS` env variable (PR #76205)

Maksim Levental via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 21:20:12 PST 2023


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/76205

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".

>From 1bab734b978094b20f63ff967438930492d8250b Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Thu, 21 Dec 2023 23:17:37 -0600
Subject: [PATCH] [lit] add `LIT_MAX_WORKERS` env variable

---
 llvm/utils/lit/lit/cl_arguments.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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",



More information about the llvm-commits mailing list