From af66b632862de20245618b6ffc8096451929f532 Mon Sep 17 00:00:00 2001 From: DavHau Date: Sun, 9 Mar 2025 14:02:34 +0700 Subject: [PATCH] clan-cli/tests: limit jobs to 16 This reduces overload on the CI, as it already runs multiple test instances in parallel (with-core, without-core, etc), and otherwise would spawn 96 workers for each of those. --- pkgs/clan-cli/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 7becf0306..537fc020f 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -142,7 +142,10 @@ pythonRuntime.pkgs.buildPythonApplication { export LOCK_NIX=$TMPDIR/nix_lock mkdir -p "$CLAN_TEST_STORE/nix/store" - python -m pytest -m "not impure and not with_core" ./tests + # limit build cores to 16 + jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))" + + python -m pytest -m "not impure and not with_core" -n $jobs ./tests touch $out ''; clan-pytest-with-core = @@ -181,7 +184,11 @@ pythonRuntime.pkgs.buildPythonApplication { mkdir -p "$CLAN_TEST_STORE/nix/var/nix/gcroots" xargs cp --recursive --target "$CLAN_TEST_STORE/nix/store" < "$closureInfo/store-paths" nix-store --load-db --store "$CLAN_TEST_STORE" < "$closureInfo/registration" - python -m pytest -m "not impure and with_core" ./tests + + # limit build cores to 16 + jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))" + + python -m pytest -m "not impure and with_core" ./tests -n $jobs touch $out ''; };