From ec738fac30887c9727a14d5a753861fb96e9e77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 16 Apr 2025 14:34:21 +0200 Subject: [PATCH] impure-checks: limit number of workers to number of tests --- checks/impure/flake-module.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/checks/impure/flake-module.nix b/checks/impure/flake-module.nix index 93609cbae..b0736fe9b 100644 --- a/checks/impure/flake-module.nix +++ b/checks/impure/flake-module.nix @@ -19,6 +19,7 @@ [ pkgs.gitMinimal pkgs.nix + pkgs.coreutils pkgs.rsync # needed to have rsync installed on the dummy ssh server ] ++ self'.packages.clan-cli-full.runtimeDependencies @@ -30,7 +31,12 @@ # this disables dynamic dependency loading in clan-cli export CLAN_NO_DYNAMIC_DEPS=1 - nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -m impure ./clan_cli $@" + jobs=$(nproc) + # Spawning worker in pytest is relatively slow, so we limit the number of jobs to 13 + # (current number of impure tests) + jobs="$((jobs > 13 ? 13 : jobs))" + + nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -n $jobs -m impure ./clan_cli $@" ''; }; }