numerous-pharmacist-91083
10/25/2024, 12:18 AMpants test
they sometimes get run in parallel causing an OOM and then random processes on my machine get killed. Is there a way to do any of the following (in order of preference):
• Test pants
that if RAM usage is > X it should stop launching new tests until other tests have finished.
• Mark individual tests as needing to be run alone without any other tests running in parallel.
• Limit the test parallelism. PANTS_TEST_BATCH_SIZE
seems like maybe it'd do that but I see more tests running than I've specified as the batch size.loud-stone-80561
10/25/2024, 12:25 AM• Mark individual tests as needing to be run alone without any other tests running in parallel.In my experience w/ both pants & bazel this seems like the safest bet - tagging tests as
heavy
/`high-memory` etc & then excluding them in your regular pants test invocation, ie pants --tag=-high-memory test ::
, and then serially executing the high-mem is reasonablenumerous-pharmacist-91083
10/25/2024, 12:31 AMthen serially executing the high-memDoes that mean I have to remember which tests were marked high-mem and then manually invoke
pants test
for each one, or is there a way to say "run all tests with this tag without any parallelism"?loud-stone-80561
10/25/2024, 12:37 AM#!/usr/bin/env bash
TARGETS=`pants --filter-target-type=python_test --tag=high-memory list ::`
for TARGET in $TARGETS;
do
pants test "$TARGET"
done
loud-stone-80561
10/25/2024, 12:37 AMnumerous-pharmacist-91083
10/25/2024, 12:40 AMbroad-processor-92400
10/25/2024, 3:38 AMpants --process-execution-local-parallelism=1 test --tag=high-memory ::
or similarbroad-processor-92400
10/25/2024, 3:40 AMfor
loop approach)elegant-florist-94385
10/25/2024, 10:23 AM[cli.alias]
--no-parallel = "--process-execution-local-parallelism=1"
to your pants.toml
, and then run your tests with pants --no-parallel test --tag=high-memory
numerous-pharmacist-91083
10/25/2024, 7:49 PM[cli.alias]
section; that's cool!